NetBSD portability fix: recover errno on runner error

Some time ago we introduced F_CLOSEM to efficiently close unused
file descriptors when using a runner. But since it also close the
file descriptor used to send back errno to glusterd, it got unable
to detect an error on execve().

Fix this by backing out F_CLOSEM usage.

BUG: 1129939
Change-Id: I40d3255555145e04e8feafaa2ff4e5fb1570e9a2
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/9447
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
This commit is contained in:
Emmanuel Dreyfus 2015-01-14 17:55:53 +01:00 committed by Vijay Bellur
parent 9ab533ff86
commit 2466f4debb

View File

@ -290,9 +290,6 @@ runner_start (runner_t *runner)
} else
ret = -1;
#else /* !GF_LINUX_HOST_OS */
#ifdef F_CLOSEM /* NetBSD */
(void)fcntl(3, F_CLOSEM);
#else /* !F_CLOSEM */
struct rlimit rl;
ret = getrlimit (RLIMIT_NOFILE, &rl);
GF_ASSERT (ret == 0);
@ -301,7 +298,6 @@ runner_start (runner_t *runner)
if (i != xpi[1])
close (i);
}
#endif /* !F_CLOSEM */
#endif /* !GF_LINUX_HOST_OS */
}