mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
cmirrord: check for result of chdir
Error exit if chdir fails.
This commit is contained in:
parent
b1640df5e6
commit
6d0abc6b48
@ -185,7 +185,11 @@ static void daemonize(void)
|
||||
}
|
||||
|
||||
setsid();
|
||||
chdir("/");
|
||||
if (chdir("/")) {
|
||||
LOG_ERROR("Failed to chdir /: %s", strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
umask(0);
|
||||
|
||||
if (close(0) || close(1) || close(2)) {
|
||||
|
Loading…
Reference in New Issue
Block a user