286 | 286 |
void i3_restart(bool forget_layout) {
|
287 | 287 |
char *restart_filename = forget_layout ? NULL : store_restart_layout();
|
288 | 288 |
|
289 | |
kill_nagbar(&config_error_nagbar_pid, true);
|
290 | |
kill_nagbar(&command_error_nagbar_pid, true);
|
|
289 |
kill_nagbar(config_error_nagbar_pid, true);
|
|
290 |
kill_nagbar(command_error_nagbar_pid, true);
|
291 | 291 |
|
292 | 292 |
restore_geometry();
|
293 | 293 |
|
|
404 | 404 |
}
|
405 | 405 |
|
406 | 406 |
/*
|
407 | |
* Kills the i3-nagbar process, if *nagbar_pid != -1.
|
|
407 |
* Kills the i3-nagbar process, if nagbar_pid != -1.
|
408 | 408 |
*
|
409 | 409 |
* If wait_for_it is set (restarting i3), this function will waitpid(),
|
410 | 410 |
* otherwise, ev is assumed to handle it (reloading).
|
411 | 411 |
*
|
412 | 412 |
*/
|
413 | |
void kill_nagbar(pid_t *nagbar_pid, bool wait_for_it) {
|
414 | |
if (*nagbar_pid == -1)
|
|
413 |
void kill_nagbar(pid_t nagbar_pid, bool wait_for_it) {
|
|
414 |
if (nagbar_pid == -1)
|
415 | 415 |
return;
|
416 | 416 |
|
417 | |
if (kill(*nagbar_pid, SIGTERM) == -1)
|
|
417 |
if (kill(nagbar_pid, SIGTERM) == -1)
|
418 | 418 |
warn("kill(configerror_nagbar) failed");
|
419 | 419 |
|
420 | 420 |
if (!wait_for_it)
|
|
424 | 424 |
* exec(), our old pid is no longer watched. So, ev won’t handle SIGCHLD
|
425 | 425 |
* for us and we would end up with a <defunct> process. Therefore we
|
426 | 426 |
* waitpid() here. */
|
427 | |
waitpid(*nagbar_pid, NULL, 0);
|
|
427 |
waitpid(nagbar_pid, NULL, 0);
|
428 | 428 |
}
|
429 | 429 |
|
430 | 430 |
/*
|