2004-11-11 Colin Walters <walters@verbum.org>
* src/NetworkManager.c (main): Use daemon(3). * info-daemon/NetworkManagerInfo.c (main): Ditto. * dispatcher-daemon/NetworkManagerDispatcher.c (main): Ditto. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@304 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2004-11-11 Colin Walters <walters@verbum.org>
|
||||||
|
|
||||||
|
* src/NetworkManager.c (main): Use daemon(3).
|
||||||
|
|
||||||
|
* info-daemon/NetworkManagerInfo.c (main): Ditto.
|
||||||
|
|
||||||
|
* dispatcher-daemon/NetworkManagerDispatcher.c (main): Ditto.
|
||||||
|
|
||||||
2004-11-10 Dan Williams <dcbw@redhat.com>
|
2004-11-10 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
Patches from j bootlab org
|
Patches from j bootlab org
|
||||||
|
@@ -379,31 +379,10 @@ int main( int argc, char *argv[] )
|
|||||||
|
|
||||||
openlog("NetworkManagerDispatcher", (become_daemon) ? LOG_CONS : LOG_CONS | LOG_PERROR, (become_daemon) ? LOG_DAEMON : LOG_USER);
|
openlog("NetworkManagerDispatcher", (become_daemon) ? LOG_CONS : LOG_CONS | LOG_PERROR, (become_daemon) ? LOG_DAEMON : LOG_USER);
|
||||||
|
|
||||||
if (become_daemon)
|
if (become_daemon && daemon (FALSE, FALSE) < 0)
|
||||||
{
|
{
|
||||||
int child_pid;
|
|
||||||
|
|
||||||
if (chdir ("/") < 0)
|
|
||||||
{
|
|
||||||
syslog( LOG_CRIT, "NetworkManagerDispatcher could not chdir to /. errno=%d", errno);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
child_pid = fork ();
|
|
||||||
switch (child_pid)
|
|
||||||
{
|
|
||||||
case -1:
|
|
||||||
syslog( LOG_ERR, "NetworkManagerDispatcher could not daemonize. errno = %d", errno );
|
syslog( LOG_ERR, "NetworkManagerDispatcher could not daemonize. errno = %d", errno );
|
||||||
break;
|
exit (1);
|
||||||
|
|
||||||
case 0:
|
|
||||||
/* Child */
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
exit (0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_type_init ();
|
g_type_init ();
|
||||||
|
@@ -201,31 +201,10 @@ int main( int argc, char *argv[] )
|
|||||||
|
|
||||||
openlog("NetworkManagerInfo", (no_daemon) ? LOG_CONS | LOG_PERROR : LOG_CONS, (no_daemon) ? LOG_USER : LOG_DAEMON);
|
openlog("NetworkManagerInfo", (no_daemon) ? LOG_CONS | LOG_PERROR : LOG_CONS, (no_daemon) ? LOG_USER : LOG_DAEMON);
|
||||||
|
|
||||||
if (!no_daemon)
|
if (!no_daemon && daemon (FALSE, FALSE) < 0)
|
||||||
{
|
{
|
||||||
int child_pid;
|
|
||||||
|
|
||||||
if (chdir ("/") < 0)
|
|
||||||
{
|
|
||||||
syslog( LOG_CRIT, "NetworkManagerInfo could not chdir to /. errno=%d", errno);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
child_pid = fork ();
|
|
||||||
switch (child_pid)
|
|
||||||
{
|
|
||||||
case -1:
|
|
||||||
syslog( LOG_ERR, "NetworkManagerInfo could not daemonize. errno = %d", errno );
|
syslog( LOG_ERR, "NetworkManagerInfo could not daemonize. errno = %d", errno );
|
||||||
break;
|
exit (1);
|
||||||
|
|
||||||
case 0:
|
|
||||||
/* Child */
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
exit (0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
app_info = g_new0 (NMIAppInfo, 1);
|
app_info = g_new0 (NMIAppInfo, 1);
|
||||||
|
@@ -710,31 +710,10 @@ int main( int argc, char *argv[] )
|
|||||||
/* Keep a current list of access points */
|
/* Keep a current list of access points */
|
||||||
wireless_scan_source = g_timeout_add (10000, nm_wireless_scan_monitor, nm_data);
|
wireless_scan_source = g_timeout_add (10000, nm_wireless_scan_monitor, nm_data);
|
||||||
|
|
||||||
if (become_daemon)
|
if (become_daemon && daemon (0, 0) < 0)
|
||||||
{
|
{
|
||||||
int child_pid;
|
|
||||||
|
|
||||||
if (chdir ("/") < 0)
|
|
||||||
{
|
|
||||||
syslog( LOG_CRIT, "NetworkManager could not chdir to /. errno=%d", errno);
|
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
child_pid = fork ();
|
|
||||||
switch (child_pid)
|
|
||||||
{
|
|
||||||
case -1:
|
|
||||||
syslog( LOG_ERR, "NetworkManager could not daemonize. errno = %d", errno );
|
syslog( LOG_ERR, "NetworkManager could not daemonize. errno = %d", errno );
|
||||||
break;
|
exit (1);
|
||||||
|
|
||||||
case 0:
|
|
||||||
/* Child */
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
exit (EXIT_SUCCESS);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wheeee!!! */
|
/* Wheeee!!! */
|
||||||
|
Reference in New Issue
Block a user