summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-sysdeps.h
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-04-06 23:15:41 +0000
committerHavoc Pennington <hp@redhat.com>2003-04-06 23:15:41 +0000
commit856361ff5b8ce701cdb447085931d3076ee52008 (patch)
tree05aa6d44983e8eff29bc45b9dc94ff8b7998fe3c /dbus/dbus-sysdeps.h
parentc8991b0f95a3b53bc98de9e029780bbe0a0b3114 (diff)
2003-04-06 Havoc Pennington <hp@pobox.com>
* dbus/dbus-sysdeps.c (_dbus_become_daemon): write the pidfile here in the parent process, so we can return an error if it fails. Also, move some of the code into the child so the parent is less hosed if we fail midway through. * bus/bus.c (bus_context_new): move pidfile detection further up in the function, before we start overwriting sockets and such. * bus/messagebus.in: adjust this a bit, not sure if it will work. * configure.in: add --with-system-pid-file and --with-system-socket 2003-04-06 Colin Walters <walters@verbum.org> * configure.in (DBUS_SYSTEM_PID_FILE): New variable. * bus/system.conf.in: Declare a pidfile. * bus/bus.c (bus_context_new): Test for an existing pid file, and create one (if appropriate). * bus/config-parser.c (enum ElementType) [ELEMENT_PIDFILE]: New. (struct BusConfigParser) [pidfile]: New. (element_type_to_name, merge_included, start_busconfig_child) (bus_config_parser_end_element, bus_config_parser_content): Handle it. (bus_config_parser_unref): Free it. (bus_config_parser_get_pidfile): New function. * bus/config-parser.h (_dbus_write_pid_file): Prototype. * dbus/dbus-errors.h (DBUS_ERROR_PIDFILE_EXISTS): New error. * dbus/dbus-sysdeps.c (_dbus_write_pid_file): New function. * dbus/dbus-sysdeps.h: Prototype it.
Diffstat (limited to 'dbus/dbus-sysdeps.h')
-rw-r--r--dbus/dbus-sysdeps.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h
index 933e2775..0a4a34dd 100644
--- a/dbus/dbus-sysdeps.h
+++ b/dbus/dbus-sysdeps.h
@@ -119,6 +119,8 @@ dbus_bool_t _dbus_get_groups (unsigned long uid,
unsigned long **group_ids,
int *n_group_ids);
+unsigned long _dbus_getpid (void);
+
typedef int dbus_atomic_t;
dbus_atomic_t _dbus_atomic_inc (dbus_atomic_t *atomic);
@@ -216,11 +218,14 @@ dbus_bool_t _dbus_close (int fd,
void _dbus_print_backtrace (void);
-dbus_bool_t _dbus_become_daemon (DBusError *error);
-
-dbus_bool_t _dbus_change_identity (unsigned long uid,
- unsigned long gid,
- DBusError *error);
+dbus_bool_t _dbus_become_daemon (const DBusString *pidfile,
+ DBusError *error);
+dbus_bool_t _dbus_write_pid_file (const DBusString *filename,
+ unsigned long pid,
+ DBusError *error);
+dbus_bool_t _dbus_change_identity (unsigned long uid,
+ unsigned long gid,
+ DBusError *error);
typedef void (* DBusSignalHandler) (int sig);