summaryrefslogtreecommitdiffstats
path: root/lem/io/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'lem/io/core.c')
-rw-r--r--lem/io/core.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/lem/io/core.c b/lem/io/core.c
index b282583..15ebd8d 100644
--- a/lem/io/core.c
+++ b/lem/io/core.c
@@ -127,16 +127,15 @@ io_open_work(struct lem_async *a)
#endif
| O_NONBLOCK, o->fd >= 0 ? o->fd :
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
- if (fd < 0
-#ifndef O_CLOXEC
- || fcntl(fd, F_SETFD, FD_CLOEXEC) == -1
-#endif
- ) {
+ if (fd < 0) {
o->flags = -errno;
return;
}
-
- if (fstat(fd, &st)) {
+ if (
+#ifndef O_CLOXEC
+ fcntl(fd, F_SETFD, FD_CLOEXEC) == -1 ||
+#endif
+ fstat(fd, &st)) {
o->flags = -errno;
close(fd);
return;