summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/de/autogen/plugin_api/hdata.txt3
-rw-r--r--doc/en/autogen/plugin_api/hdata.txt3
-rw-r--r--doc/fr/autogen/plugin_api/hdata.txt3
-rw-r--r--doc/it/autogen/plugin_api/hdata.txt3
-rw-r--r--po/cs.po6
-rw-r--r--po/de.po6
-rw-r--r--po/es.po6
-rw-r--r--po/fr.po8
-rw-r--r--po/hu.po6
-rw-r--r--po/it.po6
-rw-r--r--po/pl.po6
-rw-r--r--po/pt_BR.po6
-rw-r--r--po/ru.po6
-rw-r--r--po/weechat.pot6
-rw-r--r--src/core/wee-hook.c21
-rw-r--r--src/core/wee-hook.h2
16 files changed, 80 insertions, 17 deletions
diff --git a/doc/de/autogen/plugin_api/hdata.txt b/doc/de/autogen/plugin_api/hdata.txt
index 26a3670c7..d9790f084 100644
--- a/doc/de/autogen/plugin_api/hdata.txt
+++ b/doc/de/autogen/plugin_api/hdata.txt
@@ -444,7 +444,8 @@
| weechat | hook_fd | Hook vom Typ "fd" |
'callback' (pointer) +
'fd' (integer) +
- 'flags' (integer) |
+ 'flags' (integer) +
+ 'error' (integer) |
'last_weechat_hook_fd' +
'weechat_hooks_fd'
diff --git a/doc/en/autogen/plugin_api/hdata.txt b/doc/en/autogen/plugin_api/hdata.txt
index 30810edcf..09bfaa827 100644
--- a/doc/en/autogen/plugin_api/hdata.txt
+++ b/doc/en/autogen/plugin_api/hdata.txt
@@ -444,7 +444,8 @@
| weechat | hook_fd | hook of type "fd" |
'callback' (pointer) +
'fd' (integer) +
- 'flags' (integer) |
+ 'flags' (integer) +
+ 'error' (integer) |
'last_weechat_hook_fd' +
'weechat_hooks_fd'
diff --git a/doc/fr/autogen/plugin_api/hdata.txt b/doc/fr/autogen/plugin_api/hdata.txt
index c9fb6ac03..67b770070 100644
--- a/doc/fr/autogen/plugin_api/hdata.txt
+++ b/doc/fr/autogen/plugin_api/hdata.txt
@@ -444,7 +444,8 @@
| weechat | hook_fd | hook de type "fd" |
'callback' (pointer) +
'fd' (integer) +
- 'flags' (integer) |
+ 'flags' (integer) +
+ 'error' (integer) |
'last_weechat_hook_fd' +
'weechat_hooks_fd'
diff --git a/doc/it/autogen/plugin_api/hdata.txt b/doc/it/autogen/plugin_api/hdata.txt
index 0114c6110..e707c8d8a 100644
--- a/doc/it/autogen/plugin_api/hdata.txt
+++ b/doc/it/autogen/plugin_api/hdata.txt
@@ -444,7 +444,8 @@
| weechat | hook_fd | hook of type "fd" |
'callback' (pointer) +
'fd' (integer) +
- 'flags' (integer) |
+ 'flags' (integer) +
+ 'error' (integer) |
'last_weechat_hook_fd' +
'weechat_hooks_fd'
diff --git a/po/cs.po b/po/cs.po
index 8b02b93b7..f4a5715b8 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-06-13 21:33+0200\n"
+"POT-Creation-Date: 2011-06-22 15:36+0200\n"
"PO-Revision-Date: 2011-05-15 10:51+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2695,6 +2695,10 @@ msgstr ""
"Detekován posun systémových hodin (%+ld sekund), znovu inicializuji časovače"
#, c-format
+msgid "%sError: bad file descriptor (%d) used in hook_fd"
+msgstr ""
+
+#, c-format
msgid "End of command '%s', timeout reached (%.1fs)"
msgstr "Konec příkazu '%s', vypršel časový limit (%.lfs)"
diff --git a/po/de.po b/po/de.po
index d19ef0d4e..d64572906 100644
--- a/po/de.po
+++ b/po/de.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-06-22 10:56+0200\n"
+"POT-Creation-Date: 2011-06-22 15:36+0200\n"
"PO-Revision-Date: 2011-06-15 18:51+0100\n"
"Last-Translator: Nils G.\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2833,6 +2833,10 @@ msgstr ""
"Die Systemzeit ist nicht korrekt (%+ld Sekunden), reinitialisiere alle Uhren"
#, c-format
+msgid "%sError: bad file descriptor (%d) used in hook_fd"
+msgstr ""
+
+#, c-format
msgid "End of command '%s', timeout reached (%.1fs)"
msgstr "Befehl '%s' beendet, Zeit ist verstrichen (%.1fs)"
diff --git a/po/es.po b/po/es.po
index eefe27f28..a21c8425a 100644
--- a/po/es.po
+++ b/po/es.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-06-13 21:33+0200\n"
+"POT-Creation-Date: 2011-06-22 15:36+0200\n"
"PO-Revision-Date: 2011-05-15 10:51+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2747,6 +2747,10 @@ msgstr ""
"todos los temporizadores"
#, c-format
+msgid "%sError: bad file descriptor (%d) used in hook_fd"
+msgstr ""
+
+#, c-format
msgid "End of command '%s', timeout reached (%.1fs)"
msgstr "Fin del comando '%s', tiempo de espera alcanzado (%.1fs)"
diff --git a/po/fr.po b/po/fr.po
index 33738e72b..cc14620a1 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-06-13 21:33+0200\n"
-"PO-Revision-Date: 2011-06-13 21:33+0200\n"
+"POT-Creation-Date: 2011-06-22 15:36+0200\n"
+"PO-Revision-Date: 2011-06-22 15:28+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -2778,6 +2778,10 @@ msgstr ""
"tous les minuteurs"
#, c-format
+msgid "%sError: bad file descriptor (%d) used in hook_fd"
+msgstr "%sErreur: mauvais descripteur de fichier (%d) utilisé dans hook_fd"
+
+#, c-format
msgid "End of command '%s', timeout reached (%.1fs)"
msgstr "Fin de la commande '%s', temps maximum atteint (%.1fs)"
diff --git a/po/hu.po b/po/hu.po
index d91c8c5ec..86b8ffdd8 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-06-13 21:33+0200\n"
+"POT-Creation-Date: 2011-06-22 15:36+0200\n"
"PO-Revision-Date: 2011-05-15 10:51+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2396,6 +2396,10 @@ msgid "System clock skew detected (%+ld seconds), reinitializing all timers"
msgstr ""
#, c-format
+msgid "%sError: bad file descriptor (%d) used in hook_fd"
+msgstr ""
+
+#, c-format
msgid "End of command '%s', timeout reached (%.1fs)"
msgstr ""
diff --git a/po/it.po b/po/it.po
index a40bc8889..d1477491a 100644
--- a/po/it.po
+++ b/po/it.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-06-13 21:33+0200\n"
+"POT-Creation-Date: 2011-06-22 15:36+0200\n"
"PO-Revision-Date: 2011-05-15 10:52+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2747,6 +2747,10 @@ msgstr ""
"timer"
#, c-format
+msgid "%sError: bad file descriptor (%d) used in hook_fd"
+msgstr ""
+
+#, c-format
msgid "End of command '%s', timeout reached (%.1fs)"
msgstr "Fine comando '%s', timeout raggiunto (%.1fs)"
diff --git a/po/pl.po b/po/pl.po
index 46922b83b..47fc3c1ef 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-06-13 21:33+0200\n"
+"POT-Creation-Date: 2011-06-22 15:36+0200\n"
"PO-Revision-Date: 2011-05-15 10:52+0200\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2731,6 +2731,10 @@ msgstr ""
"wszystkie timery"
#, c-format
+msgid "%sError: bad file descriptor (%d) used in hook_fd"
+msgstr ""
+
+#, c-format
msgid "End of command '%s', timeout reached (%.1fs)"
msgstr "Kończenie komendy '%s', przekroczono dopuszczalny czas (%.1fs)"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 3a0d6a755..33e74da33 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-06-13 21:33+0200\n"
+"POT-Creation-Date: 2011-06-22 15:36+0200\n"
"PO-Revision-Date: 2011-05-15 10:52+0200\n"
"Last-Translator: Ivan Sichmann Freitas <ivansichfreitas@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2659,6 +2659,10 @@ msgid "System clock skew detected (%+ld seconds), reinitializing all timers"
msgstr ""
#, c-format
+msgid "%sError: bad file descriptor (%d) used in hook_fd"
+msgstr ""
+
+#, c-format
msgid "End of command '%s', timeout reached (%.1fs)"
msgstr ""
diff --git a/po/ru.po b/po/ru.po
index b9da6ea4c..4158b15ae 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-06-13 21:33+0200\n"
+"POT-Creation-Date: 2011-06-22 15:36+0200\n"
"PO-Revision-Date: 2011-05-15 10:52+0200\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2411,6 +2411,10 @@ msgid "System clock skew detected (%+ld seconds), reinitializing all timers"
msgstr ""
#, c-format
+msgid "%sError: bad file descriptor (%d) used in hook_fd"
+msgstr ""
+
+#, c-format
msgid "End of command '%s', timeout reached (%.1fs)"
msgstr ""
diff --git a/po/weechat.pot b/po/weechat.pot
index f2dba9b04..15efd0c22 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-06-13 21:33+0200\n"
+"POT-Creation-Date: 2011-06-22 15:36+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2063,6 +2063,10 @@ msgid "System clock skew detected (%+ld seconds), reinitializing all timers"
msgstr ""
#, c-format
+msgid "%sError: bad file descriptor (%d) used in hook_fd"
+msgstr ""
+
+#, c-format
msgid "End of command '%s', timeout reached (%.1fs)"
msgstr ""
diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c
index ffea7a7ac..15b2f2a6c 100644
--- a/src/core/wee-hook.c
+++ b/src/core/wee-hook.c
@@ -1194,6 +1194,7 @@ hook_fd (struct t_weechat_plugin *plugin, int fd, int flag_read,
new_hook_fd->callback = callback;
new_hook_fd->fd = fd;
new_hook_fd->flags = 0;
+ new_hook_fd->error = 0;
if (flag_read)
new_hook_fd->flags |= HOOK_FD_FLAG_READ;
if (flag_write)
@@ -1224,8 +1225,20 @@ hook_fd_set (fd_set *read_fds, fd_set *write_fds, fd_set *exception_fds)
if (!ptr_hook->deleted)
{
/* skip invalid file descriptors */
- if ((fcntl (HOOK_FD(ptr_hook,fd), F_GETFD) != -1)
- || (errno != EBADF))
+ if ((fcntl (HOOK_FD(ptr_hook,fd), F_GETFD) == -1)
+ && (errno == EBADF))
+ {
+ if (HOOK_FD(ptr_hook, error) == 0)
+ {
+ HOOK_FD(ptr_hook, error) = errno;
+ gui_chat_printf (NULL,
+ _("%sError: bad file descriptor (%d) "
+ "used in hook_fd"),
+ gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
+ HOOK_FD(ptr_hook, fd));
+ }
+ }
+ else
{
if (HOOK_FD(ptr_hook, flags) & HOOK_FD_FLAG_READ)
{
@@ -3152,6 +3165,7 @@ hook_hdata_hook_fd_cb (void *data, const char *hdata_name)
HDATA_VAR(struct t_hook_fd, callback, POINTER);
HDATA_VAR(struct t_hook_fd, fd, INTEGER);
HDATA_VAR(struct t_hook_fd, flags, INTEGER);
+ HDATA_VAR(struct t_hook_fd, error, INTEGER);
hdata_new_list(hdata, "weechat_hooks_fd", &weechat_hooks[HOOK_TYPE_FD]);
hdata_new_list(hdata, "last_weechat_hook_fd", &last_weechat_hook[HOOK_TYPE_FD]);
}
@@ -3654,6 +3668,8 @@ hook_add_to_infolist_type (struct t_infolist *infolist, int type,
return 0;
if (!infolist_new_var_integer (ptr_item, "flags", HOOK_FD(ptr_hook, flags)))
return 0;
+ if (!infolist_new_var_integer (ptr_item, "error", HOOK_FD(ptr_hook, error)))
+ return 0;
}
break;
case HOOK_TYPE_PROCESS:
@@ -4051,6 +4067,7 @@ hook_print_log ()
log_printf (" callback. . . . . . . : 0x%lx", HOOK_FD(ptr_hook, callback));
log_printf (" fd. . . . . . . . . . : %d", HOOK_FD(ptr_hook, fd));
log_printf (" flags . . . . . . . . : %d", HOOK_FD(ptr_hook, flags));
+ log_printf (" error . . . . . . . . : %d", HOOK_FD(ptr_hook, error));
}
break;
case HOOK_TYPE_PROCESS:
diff --git a/src/core/wee-hook.h b/src/core/wee-hook.h
index 14080b71e..054976259 100644
--- a/src/core/wee-hook.h
+++ b/src/core/wee-hook.h
@@ -174,6 +174,8 @@ struct t_hook_fd
t_hook_callback_fd *callback; /* fd callback */
int fd; /* socket or file descriptor */
int flags; /* fd flags (read,write,..) */
+ int error; /* contains errno if error occured */
+ /* with fd */
};
/* hook process */