--- init.c-orig 2014-02-10 21:11:53.478067200 +0100 +++ init.c 2014-02-10 21:15:17.598072051 +0100 @@ -2076,8 +2076,17 @@ } dup2(fds[0], fd); close(fds[0]); - fcntl(fds[1], F_SETFD, 1); - fcntl(fd, F_SETFD, 0); + + if(fcntl(fds[1], F_SETFD, 1) == -1){ + initlog(L_VB, "Failed to set close-on-exec value for pipe"); + return -1; + } + + if(fcntl(fd, F_SETFD, 0) == -1){ + initlog(L_VB, "Failed to set close-on-exec value for duplicated pipe fd"); + return -1 + } + safe_write(fds[1], Signature, 8); return fds[1];