diff options
author | John (J5) Palmieri <johnp@redhat.com> | 2006-09-11 15:24:10 +0000 |
---|---|---|
committer | John (J5) Palmieri <johnp@redhat.com> | 2006-09-11 15:24:10 +0000 |
commit | 9cfb902807e2b568a27227fb11d757ac5cdb3aae (patch) | |
tree | 524511180cd97db8ebb77f0a88a7cb813d6eb116 /bus/desktop-file.c | |
parent | 05d90f4f20c1fbbb6c532b5f62531c97ced7d63e (diff) | |
download | dbus-9cfb902807e2b568a27227fb11d757ac5cdb3aae.tar.gz |
* bus/activation.c, bus/desktop-file.c: Distinguish between OOM and
key not found
Diffstat (limited to 'bus/desktop-file.c')
-rw-r--r-- | bus/desktop-file.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/bus/desktop-file.c b/bus/desktop-file.c index d0f9dbb0..407044c9 100644 --- a/bus/desktop-file.c +++ b/bus/desktop-file.c @@ -761,22 +761,29 @@ dbus_bool_t bus_desktop_file_get_string (BusDesktopFile *desktop_file, const char *section, const char *keyname, - char **val) + char **val, + DBusError *error) { const char *raw; - + + _DBUS_ASSERT_ERROR_IS_CLEAR (error); + *val = NULL; if (!bus_desktop_file_get_raw (desktop_file, section, keyname, &raw)) - return FALSE; + { + dbus_set_error (error, DBUS_ERROR_FAILED, + "No \"%s\" key in .service file\n", keyname); + return FALSE; + } *val = _dbus_strdup (raw); - /* FIXME 1.0 we don't distinguish "key not found" from "out of memory" here, - * which is broken. - */ if (*val == NULL) - return FALSE; + { + BUS_SET_OOM (error); + return FALSE; + } return TRUE; } |