Skip to content

Commit

Permalink
Redirect --version stdout to /dev/null if not in verbose mode
Browse files Browse the repository at this point in the history
  • Loading branch information
probonopd committed Nov 26, 2024
1 parent 364bf19 commit 12107d8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/runtime/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,9 @@ char* find_fusermount(bool verbose) {
if (pid == 0) {
// Child process
char* args[] = {fusermount_full_path, "--version", NULL};
if (!verbose) {
freopen("/dev/null", "w", stdout); // Redirect stdout to /dev/null if not in verbose mode
}
execvp(fusermount_full_path, args);
// If execvp returns, it means the executable was not found
exit(1);
Expand Down

0 comments on commit 12107d8

Please sign in to comment.