Skip to content

Commit 8eeca49

Browse files
committed
iolog_open: fix check for write mode on GNU Hurd
1 parent 006513c commit 8eeca49

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/iolog/iolog_open.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ iolog_open(struct iolog_file *iol, int dfd, int iofd, const char *mode)
7070
"%s: invalid iofd %d", __func__, iofd);
7171
debug_return_bool(false);
7272
}
73-
if (iofd == IOFD_TIMING && ISSET(flags, O_WRONLY|O_RDWR)) {
73+
74+
/* Lock the timing file if opening for writing. */
75+
if (iofd == IOFD_TIMING && (mode[0] == 'w' || mode[1] == '+')) {
7476
lockit = true;
7577
}
7678

0 commit comments

Comments
 (0)