Skip to content

service: Check if the service exited during startup

Currently if a service calls gss_service_exit() during the course of its startup_async(), then the gss_service_run() call used to start it will set its @error to G_IO_ERROR_CANCELLED even if the service exited successfully (no error was passed to gss_service_exit()). This is because in gss_service_exit() we call g_cancellable_cancel(), and by default a GTask will check its GCancellable and return an error even if the task was otherwise successful (e.g. g_task_return_boolean (task, TRUE) was called).

Presumably a service which calls gss_service_exit() with a NULL @error expects its gss_service_run() to not have @error set. So add a check in gss_service_run() after calling startup_finish(): if the error is G_IO_ERROR_CANCELLED and the service has exited, return the error given to gss_service_exit() if set, and otherwise don't return an error.

Merge request reports