From e4ca1f3518b56e8fa4c64cedf518d8c84472e01d Mon Sep 17 00:00:00 2001 From: Jeremiah Orians Date: Sat, 22 Jan 2022 16:31:38 -0500 Subject: [PATCH] Produce a meaningful error message if unable to spawn essential binaries --- cc_spawn.c | 3 +++ makefile | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cc_spawn.c b/cc_spawn.c index f32f0a3..2a9fe0f 100644 --- a/cc_spawn.c +++ b/cc_spawn.c @@ -173,6 +173,9 @@ int _execute(char* name, char** array, char** envp) /* We are not fuzzing */ /* execve() returns only on error */ execve(program, array, envp); + fputs("Unable to execute: ", stderr); + fputs(program, stderr); + fputs("\nPlease check file permissions and that it is a valid binary\n", stderr); } /* Prevent infinite loops */ diff --git a/makefile b/makefile index 237e8ec..bd70b2c 100644 --- a/makefile +++ b/makefile @@ -90,7 +90,7 @@ clean: rm -rf bin/ # ./test/test0000/cleanup.sh -.PHONY: clean-temp +.PHONY: clean-tmp clean-tmp: rm -vf /tmp/M2-Mesoplanet-* rm -vf /tmp/M2-Planet-*