projects
/
~madcoder
/
pwqr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
implement poll and read
[~madcoder/pwqr.git]
/
lib
/
libpwqr.c
diff --git
a/lib/libpwqr.c
b/lib/libpwqr.c
index
f5d53a2
..
85cccac
100644
(file)
--- a/
lib/libpwqr.c
+++ b/
lib/libpwqr.c
@@
-66,9
+66,13
@@
/* }}} */
/* pwqr wrapping {{{ */
/* }}} */
/* pwqr wrapping {{{ */
-static int pwqr_create(
void
)
+static int pwqr_create(
int flags
)
{
{
- return open("/dev/"PWQR_DEVICE_NAME, O_RDWR);
+ if (flags & ~(O_NONBLOCK | O_CLOEXEC)) {
+ errno = -EINVAL;
+ return -1;
+ }
+ return open("/dev/"PWQR_DEVICE_NAME, O_RDWR | flags);
}
static int pwqr_ctl(int fd, int op, int val, void *uaddr)
}
static int pwqr_ctl(int fd, int op, int val, void *uaddr)
@@
-328,7
+332,7
@@
static int _pthread_workqueue_init_np(void)
if (pwqr_g.fd >= 0)
goto out;
if (pwqr_g.fd >= 0)
goto out;
- fd = pwqr_create();
+ fd = pwqr_create(
0
);
if (fd < 0) {
rc = -1;
goto out;
if (fd < 0) {
rc = -1;
goto out;