[patch] Distinguish between OOM and Key error

Havoc Pennington hp at redhat.com
Fri Sep 8 13:25:24 PDT 2006


John (J5) Palmieri wrote:
> diff -u -r1.45 activation.c
> --- bus/activation.c	6 Sep 2006 00:14:06 -0000	1.45
> +++ bus/activation.c	8 Sep 2006 18:05:50 -0000
> @@ -285,7 +285,8 @@
>    if (!bus_desktop_file_get_string (desktop_file,
>                                      DBUS_SERVICE_SECTION,
>                                      DBUS_SERVICE_NAME,
> -                                    &name))
> +                                    &name,
> +                                    error))
>      {
>        dbus_set_error (error, DBUS_ERROR_FAILED,
>                        "No \""DBUS_SERVICE_NAME"\" key in .service file\n");
> @@ -295,7 +296,8 @@
>    if (!bus_desktop_file_get_string (desktop_file,
>                                      DBUS_SERVICE_SECTION,
>                                      DBUS_SERVICE_EXEC,
> -                                    &exec))
> +                                    &exec,
> +                                    error))
>      {
>        dbus_set_error (error, DBUS_ERROR_FAILED,
>                        "No \""DBUS_SERVICE_EXEC"\" key in .service file\n");

This looks like it sets a new FAILED error over the top of the error 
returned from bus_desktop_file_get_string, should just leave the error 
set by the invoked function (should _DBUS_ASSERT_ERROR_IS_SET I think)

Then, should some code be checking whether the error is an OOM error or 
not? In principle on OOM the .service file should be retried later, 
while for a bad .service file it should never be retried.

Havoc



More information about the dbus mailing list