select() doesn't care about obvious user errors: if it's called without

any chance to come back (without being signaled), it now will.
For example, this is used by the sleep command (which now actually works
as it should :)).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12110 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-03-28 21:45:56 +00:00
parent eb6bc5d5ff
commit 29b183b12c
+8 -9
View File
@@ -1,7 +1,7 @@
/*
** Copyright 2002-2004, Axel Dörfler, [email protected]. All rights reserved.
** Distributed under the terms of the Haiku License.
*/
/*
* Copyright 2002-2005, Axel Dörfler, [email protected]. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#include <vfs.h>
@@ -130,11 +130,6 @@ common_select(int numfds, fd_set *readSet, fd_set *writeSet, fd_set *errorSet,
// array position is the same as the fd for select()
}
if (count < 1) {
count = B_BAD_VALUE;
goto err;
}
status = acquire_sem_etc(sync.sem, 1,
B_CAN_INTERRUPT | (timeout != -1 ? B_RELATIVE_TIMEOUT : 0), timeout);
@@ -478,6 +473,10 @@ _kern_poll(struct pollfd *fds, int numfds, bigtime_t timeout)
}
// #pragma mark -
// User syscalls
ssize_t
_user_select(int numfds, fd_set *userReadSet, fd_set *userWriteSet, fd_set *userErrorSet,
bigtime_t timeout, const sigset_t *userSigMask)