diff --git a/src/system/libroot/posix/poll.c b/src/system/libroot/posix/poll.c index 44b936e0e1..aaea2fbaf5 100644 --- a/src/system/libroot/posix/poll.c +++ b/src/system/libroot/posix/poll.c @@ -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 #include #include @@ -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; } -