diff options
author | Sjoerd Simons <sjoerd@luon.net> | 2007-11-18 23:42:24 +0100 |
---|---|---|
committer | Sjoerd Simons <sjoerd@luon.net> | 2007-11-18 23:42:24 +0100 |
commit | d314cab5b733d8340aa89d0ab40e4daa6eb3c689 (patch) | |
tree | 9e43c728cbc4201a43b4535000440367fb29f72b /hald-runner | |
parent | 1852641290ec7c0f75e85ba8ef794c0e74923677 (diff) |
assign pid to a gint64 before passing it as an _INT64 in a dbus message
This patch assigns a GPid to an gint64 before passing as a DBUS_TYPE_INT64 in a dbus message. Fixes alignment issues and ensures the correct size of the passed argument without the need to use __attribute__ ((aligned))
Diffstat (limited to 'hald-runner')
-rw-r--r-- | hald-runner/main.c | 5 | ||||
-rw-r--r-- | hald-runner/runner.c | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/hald-runner/main.c b/hald-runner/main.c index f767b9bf..accb65d8 100644 --- a/hald-runner/main.c +++ b/hald-runner/main.c @@ -137,7 +137,7 @@ handle_start(DBusConnection *con, DBusMessage *msg, gboolean is_singleton) DBusMessage *reply; DBusMessageIter iter; run_request *r; - GPid pid __attribute__ ((aligned)); + GPid pid; r = new_run_request(); r->is_singleton = is_singleton; @@ -158,9 +158,10 @@ handle_start(DBusConnection *con, DBusMessage *msg, gboolean is_singleton) } if (run_request_run(r, con, NULL, &pid)) { + gint64 ppid = pid; reply = dbus_message_new_method_return(msg); dbus_message_append_args (reply, - DBUS_TYPE_INT64, &pid, + DBUS_TYPE_INT64, &ppid, DBUS_TYPE_INVALID); } else { diff --git a/hald-runner/runner.c b/hald-runner/runner.c index cd6cf825..4847655a 100644 --- a/hald-runner/runner.c +++ b/hald-runner/runner.c @@ -181,11 +181,12 @@ out: /* emit a signal that this PID exited */ if(rd->con != NULL && rd->emit_pid_exited) { DBusMessage *signal; + gint64 ppid = rd->pid; signal = dbus_message_new_signal ("/org/freedesktop/HalRunner", "org.freedesktop.HalRunner", "StartedProcessExited"); dbus_message_append_args (signal, - DBUS_TYPE_INT64, &(rd->pid), + DBUS_TYPE_INT64, &(ppid), DBUS_TYPE_INVALID); dbus_connection_send(rd->con, signal, NULL); } |