diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f90265ddd..a6313e4b6 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Wed Jan 17 23:23:12 2001 Christopher Faylor + + * syscalls.cc (setdtablesize): Call with amount to increment not total + amount. Return success or failure error code. + Wed Jan 17 09:47:13 2001 Christopher Faylor * autoload.cc (LoadDLLinitfunc): Remove debugging statement. diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 08e99cd1b..b7b2f5cb9 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1345,11 +1345,13 @@ system (const char *cmdstring) return res; } -extern "C" void +extern "C" int setdtablesize (int size) { - if (size > (int)fdtab.size) - fdtab.extend (size); + if (size <= (int)fdtab.size || fdtab.extend (size - fdtab.size)) + return 0; + + return -1; } extern "C" int