Annotation of /trunk/hal/patches/hal-0.5.10-assign-pid-to-a-gint64-before-passing-it-as-an-_INT6.patch
Parent Directory | Revision Log
Revision 597 -
(hide annotations)
(download)
Mon May 19 19:05:19 2008 UTC (16 years, 4 months ago) by niro
File size: 1996 byte(s)
Mon May 19 19:05:19 2008 UTC (16 years, 4 months ago) by niro
File size: 1996 byte(s)
-gentoo patches
1 | niro | 597 | From 51eff7c805f15f83dfceaac3ba6740a8a624a4d3 Mon Sep 17 00:00:00 2001 |
2 | From: Sjoerd Simons <sjoerd@luon.net> | ||
3 | Date: Sun, 18 Nov 2007 23:42:24 +0100 | ||
4 | Subject: [PATCH] assign pid to a gint64 before passing it as an _INT64 in a dbus message | ||
5 | |||
6 | 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)) | ||
7 | --- | ||
8 | hald-runner/main.c | 5 +++-- | ||
9 | hald-runner/runner.c | 3 ++- | ||
10 | 2 files changed, 5 insertions(+), 3 deletions(-) | ||
11 | |||
12 | diff --git a/hald-runner/main.c b/hald-runner/main.c | ||
13 | index f767b9b..accb65d 100644 | ||
14 | --- a/hald-runner/main.c | ||
15 | +++ b/hald-runner/main.c | ||
16 | @@ -137,7 +137,7 @@ handle_start(DBusConnection *con, DBusMessage *msg, gboolean is_singleton) | ||
17 | DBusMessage *reply; | ||
18 | DBusMessageIter iter; | ||
19 | run_request *r; | ||
20 | - GPid pid __attribute__ ((aligned)); | ||
21 | + GPid pid; | ||
22 | |||
23 | r = new_run_request(); | ||
24 | r->is_singleton = is_singleton; | ||
25 | @@ -158,9 +158,10 @@ handle_start(DBusConnection *con, DBusMessage *msg, gboolean is_singleton) | ||
26 | } | ||
27 | |||
28 | if (run_request_run(r, con, NULL, &pid)) { | ||
29 | + gint64 ppid = pid; | ||
30 | reply = dbus_message_new_method_return(msg); | ||
31 | dbus_message_append_args (reply, | ||
32 | - DBUS_TYPE_INT64, &pid, | ||
33 | + DBUS_TYPE_INT64, &ppid, | ||
34 | DBUS_TYPE_INVALID); | ||
35 | |||
36 | } else { | ||
37 | diff --git a/hald-runner/runner.c b/hald-runner/runner.c | ||
38 | index cd6cf82..4847655 100644 | ||
39 | --- a/hald-runner/runner.c | ||
40 | +++ b/hald-runner/runner.c | ||
41 | @@ -181,11 +181,12 @@ out: | ||
42 | /* emit a signal that this PID exited */ | ||
43 | if(rd->con != NULL && rd->emit_pid_exited) { | ||
44 | DBusMessage *signal; | ||
45 | + gint64 ppid = rd->pid; | ||
46 | signal = dbus_message_new_signal ("/org/freedesktop/HalRunner", | ||
47 | "org.freedesktop.HalRunner", | ||
48 | "StartedProcessExited"); | ||
49 | dbus_message_append_args (signal, | ||
50 | - DBUS_TYPE_INT64, &(rd->pid), | ||
51 | + DBUS_TYPE_INT64, &(ppid), | ||
52 | DBUS_TYPE_INVALID); | ||
53 | dbus_connection_send(rd->con, signal, NULL); | ||
54 | } | ||
55 | -- | ||
56 | 1.5.3.7 | ||
57 |