diff --git a/include/util.h b/include/util.h index f0db03a55..09ad941f5 100644 --- a/include/util.h +++ b/include/util.h @@ -143,13 +143,13 @@ char *pango_escape_markup(char *input); void start_nagbar(pid_t *nagbar_pid, char *argv[]); /** - * Kills the i3-nagbar process, if *nagbar_pid != -1. + * Kills the i3-nagbar process, if nagbar_pid != -1. * * If wait_for_it is set (restarting i3), this function will waitpid(), * otherwise, ev is assumed to handle it (reloading). * */ -void kill_nagbar(pid_t *nagbar_pid, bool wait_for_it); +void kill_nagbar(pid_t nagbar_pid, bool wait_for_it); /** * Converts a string into a long using strtol(). diff --git a/src/commands.c b/src/commands.c index e6f6ef6a0..8310c8112 100644 --- a/src/commands.c +++ b/src/commands.c @@ -1615,8 +1615,8 @@ void cmd_exit(I3_CMD) { */ void cmd_reload(I3_CMD) { LOG("reloading\n"); - kill_nagbar(&config_error_nagbar_pid, false); - kill_nagbar(&command_error_nagbar_pid, false); + kill_nagbar(config_error_nagbar_pid, false); + kill_nagbar(command_error_nagbar_pid, false); load_configuration(NULL, C_RELOAD); x_set_i3_atoms(); /* Send an IPC event just in case the ws names have changed */ diff --git a/src/util.c b/src/util.c index 6d8d2ee75..2ca5b330d 100644 --- a/src/util.c +++ b/src/util.c @@ -287,8 +287,8 @@ static char *store_restart_layout(void) { void i3_restart(bool forget_layout) { char *restart_filename = forget_layout ? NULL : store_restart_layout(); - kill_nagbar(&config_error_nagbar_pid, true); - kill_nagbar(&command_error_nagbar_pid, true); + kill_nagbar(config_error_nagbar_pid, true); + kill_nagbar(command_error_nagbar_pid, true); restore_geometry(); @@ -405,17 +405,17 @@ void start_nagbar(pid_t *nagbar_pid, char *argv[]) { } /* - * Kills the i3-nagbar process, if *nagbar_pid != -1. + * Kills the i3-nagbar process, if nagbar_pid != -1. * * If wait_for_it is set (restarting i3), this function will waitpid(), * otherwise, ev is assumed to handle it (reloading). * */ -void kill_nagbar(pid_t *nagbar_pid, bool wait_for_it) { - if (*nagbar_pid == -1) +void kill_nagbar(pid_t nagbar_pid, bool wait_for_it) { + if (nagbar_pid == -1) return; - if (kill(*nagbar_pid, SIGTERM) == -1) + if (kill(nagbar_pid, SIGTERM) == -1) warn("kill(configerror_nagbar) failed"); if (!wait_for_it) @@ -425,7 +425,7 @@ void kill_nagbar(pid_t *nagbar_pid, bool wait_for_it) { * exec(), our old pid is no longer watched. So, ev won’t handle SIGCHLD * for us and we would end up with a process. Therefore we * waitpid() here. */ - waitpid(*nagbar_pid, NULL, 0); + waitpid(nagbar_pid, NULL, 0); } /*