From: Joseph Myers Date: Wed, 13 Feb 2019 13:34:24 +0000 (+0000) Subject: Avoid fall-through in test-container if execlp fails. X-Git-Tag: glibc-2.30~359 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=86140c6223b5d14d773cf3050ffd0d14977c2c2d;p=thirdparty%2Fglibc.git Avoid fall-through in test-container if execlp fails. One of the implicit-fallthrough warnings from compiling glibc with -Wextra appears to indicate an actual bug: the test-container code could fall through inappropriately if execlp returns (which only occurs on error). This patch adds appropriate error handling in this case to avoid that fall-through. Tested for x86_64. * support/test-container.c (recursive_remove): Use FAIL_EXIT1 if execlp returns. --- diff --git a/ChangeLog b/ChangeLog index 56f30076dc0..4279eeedb3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2019-02-13 Joseph Myers + + * support/test-container.c (recursive_remove): Use FAIL_EXIT1 if + execlp returns. + 2019-02-12 Wilco Dijkstra * benchtests/bench-strcasecmp.c (stupid_strcasecmp): Remove. diff --git a/support/test-container.c b/support/test-container.c index a24b24c03bb..ed911e33f90 100644 --- a/support/test-container.c +++ b/support/test-container.c @@ -361,6 +361,7 @@ recursive_remove (char *path) case 0: /* Child. */ execlp ("rm", "rm", "-rf", path, NULL); + FAIL_EXIT1 ("exec rm: %m"); default: /* Parent. */ waitpid (child, &status, 0);