mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-12 17:14:46 +02:00
Add debugging code to trace source of io.BUG_FD_SETSELECT_OUT_OF_RANGE (fd=-2).
This commit is contained in:
+13
-1
@@ -34,7 +34,19 @@ extern int fd_fileopen(const char *path, unsigned int flags);
|
|||||||
#define FD_SELECT_READ 0x1
|
#define FD_SELECT_READ 0x1
|
||||||
#define FD_SELECT_WRITE 0x2
|
#define FD_SELECT_WRITE 0x2
|
||||||
|
|
||||||
extern void fd_setselect(int fd, int flags, IOCallbackFunc iocb, void *data);
|
#define fd_setselect(fd, flags, iocb, data) do { \
|
||||||
|
if (fd < 0) \
|
||||||
|
{ \
|
||||||
|
unreal_log(ULOG_ERROR, "io", "BUG_FD_SETSELECT_NEGATIVE_FD", NULL, \
|
||||||
|
"[BUG] $file:$line: fd_setselect() call with negative fd $fd", \
|
||||||
|
log_data_string("file", __FILE__), \
|
||||||
|
log_data_integer("line", __LINE__), \
|
||||||
|
log_data_integer("fd", fd)); \
|
||||||
|
} else { \
|
||||||
|
fd_setselect_real(fd, flags, iocb, data); \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
extern void fd_setselect_real(int fd, int flags, IOCallbackFunc iocb, void *data);
|
||||||
extern void fd_select(int delay); /* backend-specific */
|
extern void fd_select(int delay); /* backend-specific */
|
||||||
extern void fd_refresh(int fd); /* backend-specific */
|
extern void fd_refresh(int fd); /* backend-specific */
|
||||||
extern void fd_fork(); /* backend-specific */
|
extern void fd_fork(); /* backend-specific */
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@
|
|||||||
/***************************************************************************************
|
/***************************************************************************************
|
||||||
* Backend-independent functions. fd_setselect() and friends *
|
* Backend-independent functions. fd_setselect() and friends *
|
||||||
***************************************************************************************/
|
***************************************************************************************/
|
||||||
void fd_setselect(int fd, int flags, IOCallbackFunc iocb, void *data)
|
void fd_setselect_real(int fd, int flags, IOCallbackFunc iocb, void *data)
|
||||||
{
|
{
|
||||||
FDEntry *fde;
|
FDEntry *fde;
|
||||||
int changed = 0;
|
int changed = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user