diff options
author | William Pitcock <nenolod@dereferenced.org> | 2018-02-23 14:47:35 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2018-02-23 14:47:35 +0000 |
commit | 1a59e495dbe68a6f5dc862f929ed38da056afbd4 (patch) | |
tree | da3d56170af88da960ec3854c0af04ee6aad81de /libgcompat | |
parent | 2bc8658e85e2cb29daa1be362a42b8234aff7c74 (diff) | |
download | gcompat-1a59e495dbe68a6f5dc862f929ed38da056afbd4.tar.gz gcompat-1a59e495dbe68a6f5dc862f929ed38da056afbd4.tar.bz2 gcompat-1a59e495dbe68a6f5dc862f929ed38da056afbd4.tar.xz gcompat-1a59e495dbe68a6f5dc862f929ed38da056afbd4.zip |
gnulib: use GCOMPAT__assert_with_reason() instead of bare assert()
Diffstat (limited to 'libgcompat')
-rw-r--r-- | libgcompat/gnulib.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libgcompat/gnulib.c b/libgcompat/gnulib.c index e0ee953..ccdec24 100644 --- a/libgcompat/gnulib.c +++ b/libgcompat/gnulib.c @@ -1,8 +1,16 @@ -#include <assert.h> #include <sys/select.h> +#include "internal.h" + +#define REASON_FD_SET_OVERFLOW \ + "Fault: Overflow in fd_set detected.\n" \ + "Description: This is caused by a programmer naively attempting to redefine FD_SETSIZE,\n" \ + " which is not allowed on POSIX platforms. The program must be either rebuilt\n" \ + " with the correct FD_SETSIZE definition, or preferably rewritten to avoid use\n" \ + " of select(2) in general. See also: poll(2).\n" \ + " libgcompat believes FD_SETSIZE to be %zu.\n" unsigned long __fdelt_chk(unsigned long size) { - assert(size < FD_SETSIZE); + GCOMPAT__assert_with_reason(size < FD_SETSIZE, REASON_FD_SET_OVERFLOW, FD_SETSIZE); return size / (sizeof(unsigned long) << 3); } |