mirror of
https://github.com/pissnet/pissircd.git
synced 2025-07-29 06:22:24 +01:00
crash on invalid fd usage if DEBUGMODE (so we can trace things)
This commit is contained in:
parent
5d25c36a6c
commit
6cf476ff8e
2 changed files with 15 additions and 0 deletions
12
src/fdlist.c
12
src/fdlist.c
|
@ -51,6 +51,9 @@ int fd_open(int fd, const char *desc)
|
|||
fd, MAXCONNECTIONS);
|
||||
ircd_log(LOG_ERROR, "[BUG] trying to add fd #%d to fd table, but MAXCONNECTIONS is %d",
|
||||
fd, MAXCONNECTIONS);
|
||||
#ifdef DEBUGMODE
|
||||
abort();
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -100,6 +103,9 @@ int fd_unmap(int fd)
|
|||
fd, MAXCONNECTIONS);
|
||||
ircd_log(LOG_ERROR, "[BUG] trying to close fd #%d in fd table, but MAXCONNECTIONS is %d",
|
||||
fd, MAXCONNECTIONS);
|
||||
#ifdef DEBUGMODE
|
||||
abort();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -191,6 +197,9 @@ void fd_desc(int fd, const char *desc)
|
|||
fd, MAXCONNECTIONS);
|
||||
ircd_log(LOG_ERROR, "[BUG] trying to modify fd #%d in fd table, but MAXCONNECTIONS is %d",
|
||||
fd, MAXCONNECTIONS);
|
||||
#ifdef DEBUGMODE
|
||||
abort();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -201,6 +210,9 @@ void fd_desc(int fd, const char *desc)
|
|||
fd);
|
||||
ircd_log(LOG_ERROR, "[BUG] trying to modify fd #%d in fd table, but this FD isn't reported open",
|
||||
fd);
|
||||
#ifdef DEBUGMODE
|
||||
abort();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,6 +77,9 @@ void fd_setselect(int fd, int flags, IOCallbackFunc iocb, void *data)
|
|||
fd, MAXCONNECTIONS);
|
||||
ircd_log(LOG_ERROR, "[BUG] trying to modify fd #%d in fd table, but MAXCONNECTIONS is %d",
|
||||
fd, MAXCONNECTIONS);
|
||||
#ifdef DEBUGMODE
|
||||
abort();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue