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 646317 - Invalid exit status
Invalid exit status
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-31 10:09 UTC by Jan de Groot
Modified: 2011-09-08 09:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix the issue (830 bytes, patch)
2011-03-31 10:30 UTC, Jan de Groot
accepted-commit_now Details | Review

Description Jan de Groot 2011-03-31 10:09:46 UTC
When using the factory, gnome-terminal initializes the exit_code as -1 and
doesn't change that status when quitting the main factory process. This can be
observed as following:

Start a different terminal, like xterm
Start gnome-terminal
exit from shell with CTRL+D
echo $? from xterm

$? will show 255, which seems to be the -1 that data->exit_code was initialized
with. When I change the line that initializes the struct to be something else,
that will become the exit status here.

I think exit_code should be initialized as EXIT_SUCCESS in src/terminal.c.

This causes bugs like these:
https://bugs.archlinux.org/task/21421
Comment 1 Jan de Groot 2011-03-31 10:30:49 UTC
Created attachment 184769 [details] [review]
Patch to fix the issue
Comment 2 Christian Persch 2011-03-31 13:08:17 UTC
Looks fine to me. Ok to commit after code freeze ends (once g-t 3.0.0 is tagged), to master and gnome-3-0 branch.
Comment 3 Ionut Biru 2011-04-24 14:50:12 UTC
3.0.1 is near. don't forget to push this fix
Comment 4 Ionut Biru 2011-04-25 23:17:03 UTC
thanks a lot of missing this one line patch.
Comment 5 Ross Vandegrift 2011-08-02 13:36:47 UTC
Looks like this wasn't committed for 3.0.1 - I'm still seeing it and the fix isn't listed in the changelog.

Thanks,
Ross
Comment 6 André Klapper 2011-08-25 17:20:28 UTC
Comment on attachment 184769 [details] [review]
Patch to fix the issue

Changing patch status as per comment 2.
Comment 7 Colin Walters 2011-08-25 17:23:03 UTC
The commit message is badly formatted; I've fixed it and pushed to master:

commit a7c6cd3823db3e0b93cfb1fb000edff3260a6858
Author: Jan de Groot <jan@jgc.homeip.net>
Date:   Thu Aug 25 13:19:47 2011 -0400

    Fix exit status of factory processes
    
    The exit status should default to EXIT_SUCCESS instead of -1. When
    things go wrong, the exit status is set to something else
    anyways.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=646317