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 */
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;
}
}