From 4e2a97b2ac38973cf392104ffab62871d06fb4ba Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 18 Jan 2001 04:26:04 +0000 Subject: [PATCH] * syscalls.cc (setdtablesize): Call with amount to increment not total amount. Return success or failure error code. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/syscalls.cc | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) 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