e354a5
commit 86140c6223b5d14d773cf3050ffd0d14977c2c2d
e354a5
Author: Joseph Myers <joseph@codesourcery.com>
e354a5
Date:   Wed Feb 13 13:34:24 2019 +0000
e354a5
e354a5
    Avoid fall-through in test-container if execlp fails.
e354a5
    
e354a5
    One of the implicit-fallthrough warnings from compiling glibc with
e354a5
    -Wextra appears to indicate an actual bug: the test-container code
e354a5
    could fall through inappropriately if execlp returns (which only
e354a5
    occurs on error).  This patch adds appropriate error handling in this
e354a5
    case to avoid that fall-through.
e354a5
    
e354a5
    Tested for x86_64.
e354a5
    
e354a5
            * support/test-container.c (recursive_remove): Use FAIL_EXIT1 if
e354a5
            execlp returns.
e354a5
e354a5
diff --git a/support/test-container.c b/support/test-container.c
e354a5
index 1d1aebeaf3412573..f0d9e3060e80bda5 100644
e354a5
--- a/support/test-container.c
e354a5
+++ b/support/test-container.c
e354a5
@@ -361,6 +361,7 @@ recursive_remove (char *path)
e354a5
   case 0:
e354a5
     /* Child.  */
e354a5
     execlp ("rm", "rm", "-rf", path, NULL);
e354a5
+    FAIL_EXIT1 ("exec rm: %m");
e354a5
   default:
e354a5
     /* Parent.  */
e354a5
     waitpid (child, &status, 0);