aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-01-18 04:26:04 +0000
committerChristopher Faylor <me@cgf.cx>2001-01-18 04:26:04 +0000
commit4e2a97b2ac38973cf392104ffab62871d06fb4ba (patch)
tree0737d3e94e9252f07bbf52cb922f3d4be74c71ee /winsup
parentd0319c3b5bcb9d2a5beb1b21f8058f0b02e832db (diff)
downloadnewlib-4e2a97b2ac38973cf392104ffab62871d06fb4ba.zip
newlib-4e2a97b2ac38973cf392104ffab62871d06fb4ba.tar.gz
newlib-4e2a97b2ac38973cf392104ffab62871d06fb4ba.tar.bz2
* syscalls.cc (setdtablesize): Call with amount to increment not total amount.
Return success or failure error code.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/syscalls.cc8
2 files changed, 10 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index f90265d..a6313e4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jan 17 23:23:12 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * 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 <cgf@cygnus.com>
* autoload.cc (LoadDLLinitfunc): Remove debugging statement.
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 08e99cd..b7b2f5c 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