mirror of https://github.com/i3/i3lock.git
Replaced system() with execl()
parent
0c4b74b297
commit
352b5d5818
5
i3lock.c
5
i3lock.c
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue