chiark
/
gitweb
/
~mdw
/
fwd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb2eca3
)
fwd.c: Check return code from `chdir'.
author
Mark Wooding
<mdw@distorted.org.uk>
Sat, 29 Jun 2013 14:03:14 +0000
(15:03 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sat, 29 Jun 2013 14:04:52 +0000
(15:04 +0100)
I don't think I care much about this one, but handling it properly is
prettier than slapping `DISCARD' on it.
fwd.c
patch
|
blob
|
blame
|
history
diff --git
a/fwd.c
b/fwd.c
index c095ba202e856ae7e09a87ef209e69598f2ef1e9..5b4e24803142669338c02c8797f883888108130d 100644
(file)
--- a/
fwd.c
+++ b/
fwd.c
@@
-650,7
+650,8
@@
int main(int argc, char *argv[])
_exit(0);
close(0); close(1); close(2);
- chdir("/");
+ if (chdir("/"))
+ die(1, "couldn't change to root directory: %s", strerror(errno));
setsid();
kid = fork();