[systemd-devel] [PATCH] main: fix error message if PR_SET_CHILD_REAPER is not available
Lennart Poettering
lennart at poettering.net
Tue Aug 21 07:49:57 PDT 2012
On Thu, 16.08.12 18:38, Marius Tolzmann (tolzmann at molgen.mpg.de) wrote:
Heya,
> ---
> src/core/main.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/core/main.c b/src/core/main.c
> index cdd77c1..8973637 100644
> --- a/src/core/main.c
> +++ b/src/core/main.c
> @@ -1511,8 +1511,8 @@ int main(int argc, char *argv[]) {
> /* Become reaper of our children */
> r = prctl(PR_SET_CHILD_SUBREAPER, 1);
> if (r < 0)
> - log_error("Failed to prctl(PR_SET_CHILD_SUBREAPER): %s", strerror(-r));
> - if (r == -EINVAL)
> + log_error("Failed to prctl(PR_SET_CHILD_SUBREAPER): %m");
> + if (r < 0 && errno == EINVAL)
> log_error("Perhaps the kernel version is too old (< 3.4?)");
> }
Actually, the error code is returned in errno, not in the retval. I now
commited a fix that corrects this properly.
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list