After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 643880 - gsm-process-helper: Give useful error data
gsm-process-helper: Give useful error data
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-04 15:44 UTC by Colin Walters
Modified: 2011-03-09 15:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gsm-process-helper: Give useful error data (8.40 KB, patch)
2011-03-04 15:44 UTC, Colin Walters
none Details | Review

Description Colin Walters 2011-03-04 15:44:13 UTC
In order for engineers to be able to extract why a tool
like gnome-session-check-accelerated failed, we should print
something to ~/.xsession-errors.

gsm_process_helper() only returned the exit code, unless the process
was killed by a signal, in which case it returned -1.  However
the only consumer of the code never checked the exit code, just
success.

So fix this by having gsm_process_helper return a normal
gboolean/GError pair.  As part of this, clean up the code so that it
also handles the WIFSIGNALED and WIFSTOPPED cases (See "man 2 waitpid").

Also, the exit_child_simple() function was lame; we don't
need to call g_spawn_close_pid() on Unix, so don't do it.
Comment 1 Colin Walters 2011-03-04 15:44:16 UTC
Created attachment 182490 [details] [review]
gsm-process-helper: Give useful error data
Comment 2 Matthias Clasen 2011-03-05 00:05:13 UTC
+                session_runnable = (gsm_process_helper (value, GSM_RUNNABLE_HELPER_TIMEOUT, &error) == 0);

That should be == TRUE now, right ? or just gsm_process_helper (), without any comparisons, since the return value is a boolean.


Other than that, looks great to me