From 657539bcbf70f46cc21bfc1244b5859fa0f6a3b9 Mon Sep 17 00:00:00 2001 From: Blake McBride Date: Sun, 3 Jan 2021 12:56:57 -0600 Subject: [PATCH] Correctly terminate execl() (#169) --- src/uraid.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/uraid.c b/src/uraid.c index 1fb7266..565f6f9 100644 --- a/src/uraid.c +++ b/src/uraid.c @@ -784,7 +784,7 @@ LispPTR uraid_commands() { switch (vfork()) { case -1: (void)fprintf(stderr, "uraid: Fork failed.\n"); exit(1); - case 0: (void)execl("/bin/sh", "sh", "-i", 0); exit(1); + case 0: (void)execl("/bin/sh", "sh", "-i", NULL); exit(1); default: break; } @@ -971,7 +971,7 @@ int device_before_raid() { case -1: /* Error */ (void)fprintf(stderr, "display_before_exit: Fork failed.\n"); exit(1); case 0: /* Child */ - (void)execl(SV_RELEASE, "sv_release", 0); + (void)execl(SV_RELEASE, "sv_release", NULL); /* should not return */ (void)fprintf(stderr, "display_before_exit: exec for sv_release failed\n"); exit(1); @@ -1156,7 +1156,7 @@ static int re_init_display(int lisp_display_addr, int display_max) case -1: /* Error */ (void)fprintf(stderr, "re_init_display: Fork failed.\n"); exit(1); case 0: /* Child */ - (void)execl(SV_ACQUIRE, "sv_acquire", "0", "256", "250", 0); + (void)execl(SV_ACQUIRE, "sv_acquire", "0", "256", "250", NULL); /* should not return */ (void)fprintf(stderr, "re_init_display: exec for sv_acquire failed\n"); exit(1); @@ -1264,7 +1264,7 @@ static int re_init_display(int lisp_display_addr, int display_max) case -1: /* Error */ (void)fprintf(stderr, "re_init_display: Fork failed.\n"); exit(1); case 0: /* Child */ - (void)execl(SV_ACQUIRE, "sv_acquire", "0", "256", "250", 0); + (void)execl(SV_ACQUIRE, "sv_acquire", "0", "256", "250", NULL); /* should not return */ (void)fprintf(stderr, "re_init_display: exec for sv_acquire failed\n"); exit(1);