]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mworker: display an accurate error when the reexec fail
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 15 Nov 2017 18:02:55 +0000 (19:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 15 Nov 2017 18:52:06 +0000 (19:52 +0100)
When the master worker fail the execvp, it returns the wrong error
"Cannot allocate memory".

We now display the accurate error corresponding to the errno value.

src/haproxy.c

index b4f6a4f880cdd035a65f0c119b8aa92861783802..28811a84f9f2a75bfa8a4436fed15a455bc0d6ed 100644 (file)
@@ -652,9 +652,11 @@ static void mworker_reload()
        Warning("Reexecuting Master process\n");
        execvp(next_argv[0], next_argv);
 
+       Warning("Failed to reexecute the master process [%d]: %s\n", pid, strerror(errno));
+       return;
+
 alloc_error:
-       Warning("Cannot allocate memory\n");
-       Warning("Failed to reexecute the master processs [%d]\n", pid);
+       Warning("Failed to reexecute the master processs [%d]: Cannot allocate memory\n", pid);
        return;
 }
 
@@ -732,8 +734,6 @@ void reexec_on_failure()
 
        Warning("Reexecuting Master process in waitpid mode\n");
        mworker_reload();
-
-       Warning("Failed to reexecute the master processs\n");
 }