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.
This commit is contained in:
parent
16f87cfd63
commit
86140c6223
@ -1,3 +1,8 @@
|
|||||||
|
2019-02-13 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
* support/test-container.c (recursive_remove): Use FAIL_EXIT1 if
|
||||||
|
execlp returns.
|
||||||
|
|
||||||
2019-02-12 Wilco Dijkstra <wdijkstr@arm.com>
|
2019-02-12 Wilco Dijkstra <wdijkstr@arm.com>
|
||||||
|
|
||||||
* benchtests/bench-strcasecmp.c (stupid_strcasecmp): Remove.
|
* benchtests/bench-strcasecmp.c (stupid_strcasecmp): Remove.
|
||||||
|
@ -361,6 +361,7 @@ recursive_remove (char *path)
|
|||||||
case 0:
|
case 0:
|
||||||
/* Child. */
|
/* Child. */
|
||||||
execlp ("rm", "rm", "-rf", path, NULL);
|
execlp ("rm", "rm", "-rf", path, NULL);
|
||||||
|
FAIL_EXIT1 ("exec rm: %m");
|
||||||
default:
|
default:
|
||||||
/* Parent. */
|
/* Parent. */
|
||||||
waitpid (child, &status, 0);
|
waitpid (child, &status, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user