[tuxdroid-svn] r300 - daemon/trunk
Status: Beta
Brought to you by:
ks156
From: neimad <c2m...@c2...> - 2007-05-02 15:44:19
|
Author: neimad Date: 2007-05-02 17:44:16 +0200 (Wed, 02 May 2007) New Revision: 300 Modified: daemon/trunk/main.c Log: * Check for running daemon *after* options have been processed, so that the user may get help even when the daemon's running. Modified: daemon/trunk/main.c =================================================================== --- daemon/trunk/main.c 2007-05-02 15:16:36 UTC (rev 299) +++ daemon/trunk/main.c 2007-05-02 15:44:16 UTC (rev 300) @@ -279,12 +279,6 @@ /* On exiting */ signal(SIGINT, on_close_daemon); - /* Only one instance of the daemon is authorized */ - if (check_pid()) - { - printf("Tuxdaemon is already launched !\n"); - exit(0); - } /* Program arguments */ for (i = 1; i < argc; i++) { @@ -316,6 +310,13 @@ } } + /* Only one instance of the daemon is authorized */ + if (check_pid()) + { + printf("Tuxdaemon is already launched !\n"); + exit(0); + } + if (daemonized) daemonize(log_target, log_level); else |