summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2005-05-08 15:41:39 +0000
committerHavoc Pennington <hp@redhat.com>2005-05-08 15:41:39 +0000
commit0e0b8c197da0af602f4f520110feef23987d70ce (patch)
tree3a618e94f58ae6a5ea451cc5dd01a03da0f73372
parent4db285c800a68245ad7593e606ca8cb2c21a1329 (diff)
2005-05-08 Havoc Pennington <hp@redhat.com>
* dbus/dbus-sysdeps-util.c (_dbus_become_daemon): write the daemon's pid, not the parent's pid, to the file descriptor. Reported by Taj Morton.
-rw-r--r--ChangeLog6
-rw-r--r--dbus/dbus-sysdeps-util.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1fbbf859..0c7f6a2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-05-08 Havoc Pennington <hp@redhat.com>
+
+ * dbus/dbus-sysdeps-util.c (_dbus_become_daemon): write the
+ daemon's pid, not the parent's pid, to the file descriptor.
+ Reported by Taj Morton.
+
2005-05-05 Havoc Pennington <hp@redhat.com>
* configure.in (LT_*): add notes on how the libtool versioning
diff --git a/dbus/dbus-sysdeps-util.c b/dbus/dbus-sysdeps-util.c
index 5c9921e0..68c2a706 100644
--- a/dbus/dbus-sysdeps-util.c
+++ b/dbus/dbus-sysdeps-util.c
@@ -56,7 +56,7 @@
* Does the chdir, fork, setsid, etc. to become a daemon process.
*
* @param pidfile #NULL, or pidfile to create
- * @param print_pid_fd file descriptor to print pid to, or -1 for none
+ * @param print_pid_fd file descriptor to print daemon's pid to, or -1 for none
* @param error return location for errors
* @returns #FALSE on failure
*/
@@ -142,7 +142,7 @@ _dbus_become_daemon (const DBusString *pidfile,
return FALSE;
}
- if (!_dbus_string_append_int (&pid, _dbus_getpid ()) ||
+ if (!_dbus_string_append_int (&pid, child_pid) ||
!_dbus_string_append (&pid, "\n"))
{
_dbus_string_free (&pid);