1
0
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:
Zdenek Kabelac 2012-06-20 00:10:40 +02:00
parent b1640df5e6
commit 6d0abc6b48

View File

@ -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)) {