aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2024-02-27 12:22:13 -0800
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2024-02-27 12:22:13 -0800
commit11afce24ad85f7413582a2918a049466d62cda91 (patch)
tree2e76d04a5e1bb8908dde10df6826e9f5a7a731ec
parent1aebdfb9b77d5f71a5aa9faa13beab1f382cf30c (diff)
downloadslock-11afce24ad85f7413582a2918a049466d62cda91.tar.gz
slock-11afce24ad85f7413582a2918a049466d62cda91.tar.xz
die on failed freopenHEADmaster
-rw-r--r--slock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/slock.c b/slock.c
index edd4440..6f63d3d 100644
--- a/slock.c
+++ b/slock.c
@@ -405,7 +405,8 @@ main(int argc, char **argv) {
case -1:
die("slock: fork failed: %s\n", strerror(errno));
case 0:
- freopen("/dev/null", "w", stdout);
+ if (!freopen("/dev/null", "w", stdout))
+ die("slock: freopen: %s\n", strerror(errno));
break;
default:
if (opt_pid)