Replaced system() with execl()

pull/190/head
Jonas Röger 2018-06-18 21:29:42 +02:00
parent 0c4b74b297
commit 352b5d5818
1 changed files with 2 additions and 3 deletions

View File

@ -369,13 +369,12 @@ static void input_done(void) {
/* execute on max failed attempts, if enabled */ /* execute on max failed attempts, if enabled */
if (max_failed_attempts_enabled && failed_attempts > max_failed_attempts) { if (max_failed_attempts_enabled && failed_attempts > max_failed_attempts) {
/* This "double" fork is needed, because system() blocks */
if (!fork()) { if (!fork()) {
/* Child */ /* Child */
if (max_failed_attempts_exec) execl("/bin/sh", "sh", "-c", max_failed_attempts_exec, NULL);
system(max_failed_attempts_exec);
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
free(max_failed_attempts_exec);
max_failed_attempts_enabled = false; max_failed_attempts_enabled = false;
} }
} }