Skip to content

Commit

Permalink
Correct devnull2 flags
Browse files Browse the repository at this point in the history
  • Loading branch information
rootmos committed Nov 8, 2022
1 parent e41bd68 commit 03bb6cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION_MAJOR=0
VERSION_MINOR=9
VERSION_PATCH=0
VERSION_PATCH=1
5 changes: 2 additions & 3 deletions tools/r.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// libr 0.2.0 (1dbe1799252e4b97a820e44d38c2726ce8a3af16) (https://github.com/rootmos/libr.git) (2022-11-07T15:06:05+01:00)
// libr 0.2.0 (c2d53939d7b3587873a08543075063c6590b39bb) (https://github.com/rootmos/libr.git) (2022-11-08T06:46:29+01:00)
// modules: fail logging now util char devnull

#ifndef LIBR_HEADER
Expand Down Expand Up @@ -157,7 +157,7 @@ inline int is_whitespace(char c)
// libr: devnull.h

int devnull(int flags);
void devnull_to(int fd);
void devnull2(int fd, int flags);
#endif // LIBR_HEADER

#ifdef LIBR_IMPLEMENTATION
Expand Down Expand Up @@ -249,7 +249,6 @@ const char* now_iso8601_compact(void)

int devnull(int flags)
{
flags |= O_CLOEXEC;
int fd = open("/dev/null", flags);
CHECK(fd, "open(/dev/null, %d)", flags);
return fd;
Expand Down
2 changes: 1 addition & 1 deletion tools/strace-log-watch.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ static void trace_init(struct trace* t, const char* dir, const char* name)
r = sigprocmask(SIG_UNBLOCK, &state.sm, NULL);
CHECK(r, "sigprocmask");

devnull2(0, 0);
devnull2(0, O_RDONLY);
r = dup2(pipefd[1], 1); CHECK(r, "dup2(.., 1)");

r = execlp("tail", "tail", "--lines=+1", "--follow", path, NULL);
Expand Down

0 comments on commit 03bb6cb

Please sign in to comment.