Patch by Vasilis Kaoutsis: Correctly set errno on error.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22519 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
36b89f8f12
commit
e8cae7424e
@ -1,9 +1,10 @@
|
||||
/*
|
||||
** Copyright 2002-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
** Distributed under the terms of the OpenBeOS License.
|
||||
*/
|
||||
* Copyright 2002-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
* Distributed under the terms of the OpenBeOS License.
|
||||
*/
|
||||
|
||||
|
||||
#include <errno.h>
|
||||
#include <poll.h>
|
||||
#include <syscalls.h>
|
||||
|
||||
@ -11,6 +12,10 @@
|
||||
int
|
||||
poll(struct pollfd *fds, nfds_t numfds, int timeout)
|
||||
{
|
||||
return _kern_poll(fds, numfds, timeout * 1000LL);
|
||||
int result = _kern_poll(fds, numfds, timeout * 1000LL);
|
||||
if (result < 0) {
|
||||
errno = result;
|
||||
return -1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user