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:
@@ -1,9 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2002-2004, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2002-2007, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
** Distributed under the terms of the OpenBeOS License.
|
* Distributed under the terms of the OpenBeOS License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <syscalls.h>
|
#include <syscalls.h>
|
||||||
|
|
||||||
@@ -11,6 +12,10 @@
|
|||||||
int
|
int
|
||||||
poll(struct pollfd *fds, nfds_t numfds, int timeout)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user