diff options
| author | Magnus Henoch | 2008-01-03 16:35:44 +0000 |
|---|---|---|
| committer | Magnus Henoch | 2008-01-03 16:35:44 +0000 |
| commit | 2c3a8b2787630e00001176629c7938377060ea76 (patch) | |
| tree | a27c8a3db0e8e7adac2fa98c931b83a9f917960e /src | |
| parent | 8bba1b5cbb2dd408ab73c971fa97b33657d159ec (diff) | |
| download | emacs-2c3a8b2787630e00001176629c7938377060ea76.tar.gz emacs-2c3a8b2787630e00001176629c7938377060ea76.zip | |
* dbusbind.c (Fdbus_call_method): Handle the case of no returned
arguments.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 1 | ||||
| -rw-r--r-- | src/dbusbind.c | 19 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a8cccf957b4..10ed2dc890a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | * dbusbind.c (xd_append_arg): Use unsigned char instead of | 3 | * dbusbind.c (xd_append_arg): Use unsigned char instead of |
| 4 | unsigned int for byte values (necessary for big-endian platform). | 4 | unsigned int for byte values (necessary for big-endian platform). |
| 5 | (Fdbus_call_method): Handle the case of no returned arguments. | ||
| 5 | 6 | ||
| 6 | 2007-12-31 Tom Tromey <tromey@redhat.com> (tiny change) | 7 | 2007-12-31 Tom Tromey <tromey@redhat.com> (tiny change) |
| 7 | 8 | ||
diff --git a/src/dbusbind.c b/src/dbusbind.c index 1b6642b834f..a0c928d0eea 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c | |||
| @@ -813,18 +813,19 @@ usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &rest ARGS) */) | |||
| 813 | result = Qnil; | 813 | result = Qnil; |
| 814 | GCPRO1 (result); | 814 | GCPRO1 (result); |
| 815 | 815 | ||
| 816 | if (!dbus_message_iter_init (reply, &iter)) | 816 | if (dbus_message_iter_init (reply, &iter)) |
| 817 | { | 817 | { |
| 818 | UNGCPRO; | 818 | /* Loop over the parameters of the D-Bus reply message. Construct a |
| 819 | xsignal1 (Qdbus_error, build_string ("Cannot read reply")); | 819 | Lisp list, which is returned by `dbus-call-method'. */ |
| 820 | while ((dtype = dbus_message_iter_get_arg_type (&iter)) != DBUS_TYPE_INVALID) | ||
| 821 | { | ||
| 822 | result = Fcons (xd_retrieve_arg (dtype, &iter), result); | ||
| 823 | dbus_message_iter_next (&iter); | ||
| 824 | } | ||
| 820 | } | 825 | } |
| 821 | 826 | else | |
| 822 | /* Loop over the parameters of the D-Bus reply message. Construct a | ||
| 823 | Lisp list, which is returned by `dbus-call-method'. */ | ||
| 824 | while ((dtype = dbus_message_iter_get_arg_type (&iter)) != DBUS_TYPE_INVALID) | ||
| 825 | { | 827 | { |
| 826 | result = Fcons (xd_retrieve_arg (dtype, &iter), result); | 828 | /* No arguments: just return nil. */ |
| 827 | dbus_message_iter_next (&iter); | ||
| 828 | } | 829 | } |
| 829 | 830 | ||
| 830 | /* Cleanup. */ | 831 | /* Cleanup. */ |