Skip to content

Commit

Permalink
Output to /dev/null if no logfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Moe-hacker committed Nov 30, 2024
1 parent 88990b6 commit 392384c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ruri.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,11 @@ static void parse_args(int argc, char **_Nonnull argv, struct RURI_CONTAINER *_N
dup2(logfd, STDOUT_FILENO);
dup2(logfd, STDERR_FILENO);
close(logfd);
} else {
int nullfd = open("/dev/null", O_RDWR);
dup2(nullfd, STDOUT_FILENO);
dup2(nullfd, STDERR_FILENO);
close(nullfd);
}
}
// Build the caplist to drop.
Expand Down

0 comments on commit 392384c

Please sign in to comment.