From 352b5d581800e9e8ef37b12d56a30f12fcddceb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20R=C3=B6ger?= Date: Mon, 18 Jun 2018 21:29:42 +0200 Subject: [PATCH] Replaced system() with execl() --- i3lock.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/i3lock.c b/i3lock.c index 71ebf05..aa97a7f 100644 --- a/i3lock.c +++ b/i3lock.c @@ -369,13 +369,12 @@ static void input_done(void) { /* execute on max failed attempts, if enabled */ if (max_failed_attempts_enabled && failed_attempts > max_failed_attempts) { - /* This "double" fork is needed, because system() blocks */ if (!fork()) { /* Child */ - if (max_failed_attempts_exec) - system(max_failed_attempts_exec); + execl("/bin/sh", "sh", "-c", max_failed_attempts_exec, NULL); exit(EXIT_SUCCESS); } + free(max_failed_attempts_exec); max_failed_attempts_enabled = false; } }