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 509204 - child-exited signal does not provide exit code
child-exited signal does not provide exit code
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
[fixed-next]
Depends on:
Blocks: 491807 vte1.0
 
 
Reported: 2008-01-13 20:28 UTC by Colin Walters
Modified: 2014-04-06 17:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add new signal which includes pid and exit status (2.87 KB, patch)
2008-02-05 02:04 UTC, Colin Walters
needs-work Details | Review
[PATCH] Add vte_terminal_get_child_exit_status() so we can get the child's exit status from withint the child-exited signal handlers. Bug #509204. (1.87 KB, patch)
2008-05-29 18:16 UTC, Christian Persch
committed Details | Review

Description Colin Walters 2008-01-13 20:28:45 UTC
void (*child_exited)(VteTerminal* terminal);

It would be nice if we could get the exit status of the subprocess.
Comment 1 Colin Walters 2008-02-05 02:04:07 UTC
Created attachment 104454 [details] [review]
add new signal which includes pid and exit status
Comment 2 Christian Persch 2008-05-29 18:16:01 UTC
Created attachment 111755 [details] [review]
[PATCH] Add vte_terminal_get_child_exit_status() so we can get the child's exit status from withint the child-exited signal handlers. Bug #509204.

 src/vte-private.h |    1 +
 src/vte.c         |   19 +++++++++++++++++++
 src/vte.h         |    2 ++
 3 files changed, 22 insertions(+), 0 deletions(-)
Comment 3 Christian Persch 2008-05-29 18:16:01 UTC
This patch isn't ABI compatible...

I have also a patch for this, which simply adds an accessor function to get the child exit status, since we cannot compatibly change the signal signature either.

Also in my testing, the child's exist status as seen by the reaper is the real exist status * 256... any ideas why that would be ?
Comment 4 Christian Persch 2008-05-29 18:19:06 UTC
Well that is weird. I git-send-bugzilla'd AFTER adding my comment, but bz inversed them... so the ABI remark in comment 3 paragraph 1 applies to the patch in comment 1, not my patch in comment 2.
Comment 5 Colin Walters 2008-05-29 18:45:30 UTC
Hm, why wouldn't my patch be ABI compatible?  It adds a new signal and leaves the existing one in place as is.

It doesn't matter to me though whether there is a new signal or a new special function to call inside the old signal.
Comment 6 Christian Persch 2008-05-29 18:50:43 UTC
Because it changes the VteTerminalClass size and layout. You could get around that with just moving the definitions in place of the reserved slot, of course.
Comment 7 Colin Walters 2008-05-29 19:23:16 UTC
Ah, right; thanks for noticing that.  Ok, if the VTE maintainer thinks the additional signal approach is preferable to a function, I'll provide a new patch.
Comment 8 Colin Walters 2008-05-29 19:28:09 UTC
BTW in response to Comment #3 about the exit status being 256; on Unix exit codes are encoded with why the process exited; see section "25.6.2 Exit Status" of the glibc manual.
Comment 9 Christian Persch 2008-07-10 09:51:27 UTC
Behdad, Chris: which patch of the two above do you prefer, a new signal or a function to get the exit status in the handler to the existing signal?
Comment 10 Christian Persch 2008-10-06 20:15:28 UTC
I committed the patch that adds the vte_terminal_get_child_exit_status() function, since it doesn't require using one of the reserved slots in the class struct for the new signal.
However I think the other patch that fixes the signal is better, so I'll leave this open so we change this next time we break API/ABI.