X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fstartup.c;h=b1a2f60215550d9585a7f24efbebb243e2c672cd;hb=0b5a2092a08f7e4463b5d52e11d84750af84e73c;hp=b7950c20b40ca18cc293654b0752f545bd759843;hpb=2248085c5c4daf571b93b14a2a1aa35cfc8d63d7;p=i3%2Fi3 diff --git a/src/startup.c b/src/startup.c index b7950c20..b1a2f602 100644 --- a/src/startup.c +++ b/src/startup.c @@ -1,5 +1,3 @@ -#undef I3__FILE__ -#define I3__FILE__ "startup.c" /* * vim:ts=4:sw=4:expandtab * @@ -13,6 +11,7 @@ * */ #include "all.h" + #include "sd-daemon.h" #include @@ -50,6 +49,7 @@ static void startup_timeout(EV_P_ ev_timer *w, int revents) { if (!sequence) { DLOG("Sequence already deleted, nevermind.\n"); + free(w); return; } @@ -103,8 +103,8 @@ static int _prune_startup_sequences(void) { */ void startup_sequence_delete(struct Startup_Sequence *sequence) { assert(sequence != NULL); - DLOG("Deleting startup sequence %s, delete_at = %ld, current_time = %ld\n", - sequence->id, sequence->delete_at, time(NULL)); + DLOG("Deleting startup sequence %s, delete_at = %lld, current_time = %lld\n", + sequence->id, (long long)sequence->delete_at, (long long)time(NULL)); /* Unref the context, will be free()d */ sn_launcher_context_unref(sequence->context); @@ -191,7 +191,7 @@ void start_application(const char *command, bool no_startup_id) { if (!no_startup_id) sn_launcher_context_setup_child_process(context); - execl(_PATH_BSHELL, _PATH_BSHELL, "-c", command, (void *)NULL); + execl(_PATH_BSHELL, _PATH_BSHELL, "-c", command, NULL); /* not reached */ } _exit(0); @@ -239,8 +239,8 @@ void startup_monitor_event(SnMonitorEvent *event, void *userdata) { /* Mark the given sequence for deletion in 30 seconds. */ time_t current_time = time(NULL); sequence->delete_at = current_time + 30; - DLOG("Will delete startup sequence %s at timestamp %ld\n", - sequence->id, sequence->delete_at); + DLOG("Will delete startup sequence %s at timestamp %lld\n", + sequence->id, (long long)sequence->delete_at); if (_prune_startup_sequences() == 0) { DLOG("No more startup sequences running, changing root window cursor to default pointer.\n");