1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 17:53:13 +02:00

core: fix crash if a file descriptor used in hook_fd() is too high (> 1024 on Linux/BSD) (closes #465)

The calls to select() are replaced by poll(), which doesn't have limitation
on file descriptor number.
This commit is contained in:
Sébastien Helleu
2015-07-18 20:03:34 +02:00
parent 23983b125a
commit 3b2ee85b04
9 changed files with 182 additions and 132 deletions
+3
View File
@@ -7228,6 +7228,8 @@ hook = weechat.hook_timer(20 * 1000, 0, 0, "my_timer_cb", "")
==== hook_fd
_Updated in 1.3._
Hook a file descriptor (file or socket).
Prototype:
@@ -7249,6 +7251,7 @@ Arguments:
* 'flag_read': 1 = catch read event, 0 = ignore
* 'flag_write': 1 = catch write event, 0 = ignore
* 'flag_exception': 1 = catch exception event, 0 = ignore
(_WeeChat ≥ 1.3_: this argument is ignored and not used any more)
* 'callback': function called a selected event occurs for file (or socket),
arguments and return value:
** 'void *data': pointer
+3
View File
@@ -7352,6 +7352,8 @@ hook = weechat.hook_timer(20 * 1000, 0, 0, "my_timer_cb", "")
==== hook_fd
_Mis à jour dans la 1.3._
Accrocher un descripteur de fichier (fichier ou socket).
Prototype :
@@ -7373,6 +7375,7 @@ Paramètres :
* 'flag_read' : 1 = intercepter un évènement de lecture, 0 = ignorer
* 'flag_write' : 1 = intercepter un évènement d'écriture, 0 = ignorer
* 'flag_exception' : 1 = intercepter un évènement d'exception, 0 = ignorer
(_WeeChat ≥ 1.3_ : ce paramètre est ignoré et n'est plus utilisé)
* 'callback' : fonction appelée lorsqu'un des évènements sélectionnés se
produit pour le fichier (ou le socket), paramètres et valeur de retour :
** 'void *data' : pointeur
+5
View File
@@ -7391,6 +7391,9 @@ hook = weechat.hook_timer(20 * 1000, 0, 0, "my_timer_cb", "")
==== hook_fd
// TRANSLATION MISSING
_Updated in 1.3._
Hook su un descrittore file (file oppure socket).
Prototipo:
@@ -7411,7 +7414,9 @@ Argomenti:
* 'fd': descrittore file
* 'flag_read': 1 = cattura l'evento lettura (read), 0 = ignora
* 'flag_write': 1 = cattura l'evento scrittura (write), 0 = ignora
// TRANSLATION MISSING
* 'flag_exception': 1 = cattura l'eccezione evento (event), 0 = ignora
(_WeeChat ≥ 1.3_: this argument is ignored and not used any more)
* 'callback': funzione che chiama un evento selezionato che si verifica
per un file (o un socket), argomenti e valore restituito:
** 'void *data': puntatore
+4
View File
@@ -7227,6 +7227,8 @@ hook = weechat.hook_timer(20 * 1000, 0, 0, "my_timer_cb", "")
==== hook_fd
_バージョン 1.3 で更新。_
ファイルディスクリプタ (ファイルやソケット) をフック。
プロトタイプ:
@@ -7247,7 +7249,9 @@ struct t_hook *weechat_hook_fd (int fd,
* 'fd': ファイルディスクリプタ
* 'flag_read': 1 = 読み込みイベントをキャッチ、0 = 無視
* 'flag_write': 1 = 書き込みイベントをキャッチ、0 = 無視
// TRANSLATION MISSING
* 'flag_exception': 1 = 例外イベントをキャッチ、0 = 無視
(_WeeChat ≥ 1.3_: this argument is ignored and not used any more)
* 'callback': ファイル (またはソケット) に対してキャッチしたいイベントが発生した場合に実行する関数、
引数と戻り値:
** 'void *data': ポインタ