http://bugs.winehq.org/show_bug.cgi?id=9849
Summary: in win16 apps, exit status is lost, and always reported as 0 Product: Wine Version: 0.9.45. Platform: Other OS/Version: other Status: NEW Keywords: download, source Severity: normal Priority: P2 Component: wine-dos AssignedTo: wine-bugs@winehq.org ReportedBy: dank@kegel.com
Simple win16 programs that just terminate with nonzero status do so properly on winxp, but on wine, wine terminates with zero status. This is easy to test with openwatcom and a trivial C program, e.g.
#include <stdlib.h> #include <unistd.h>
extern void myexit( void ); #pragma aux myexit = \ "mov ax,4c01h" \ "int 21h"
int main() { /*exit(1); _exit(1); __exit(1);*/ myexit(); return 1; }
I compiled this with the overly complicated commandline
wine wcc '-i=C:\WATCOM\h\win;C:\WATCOM\h'-zW -e25 -zq -od -d2 -bw-bt=windows foo.c wine wlink file foo.obj
To test, do wine foo.exe echo $?
It should output 1, but it outputs 0.
http://bugs.winehq.org/show_bug.cgi?id=9849
--- Comment #1 from Austin English austinenglish@gmail.com 2008-11-16 16:48:06 --- Created an attachment (id=17319) --> (http://bugs.winehq.org/attachment.cgi?id=17319) foo.exe
Still present in git.
http://bugs.winehq.org/show_bug.cgi?id=9849
--- Comment #2 from Dmitry Timoshkov dmitry@codeweavers.com 2008-11-17 03:25:30 --- Attached foo.exe returns with status 0 under XP SP3 in the following test.bat file:
<quote> rem foo32.exe foo.exe if ERRORLEVEL == 1 goto error echo 0 exit :error echo 1 </quote>
while foo32.exe which only does ExitProcess(1) in its main() prints 1.
Dan, how did you test this under XP?
http://bugs.winehq.org/show_bug.cgi?id=9849
--- Comment #3 from Dan Kegel dank@kegel.com 2008-11-23 18:26:44 --- It's been a while, not sure how I tested.
But that errorlevel check syntax you used might be wrong, see http://www.robvanderwoude.com/errorlevel.html I think you need to leave out the ==.
http://bugs.winehq.org/show_bug.cgi?id=9849
--- Comment #4 from Dmitry Timoshkov dmitry@codeweavers.com 2008-11-23 23:38:25 --- (In reply to comment #3)
It's been a while, not sure how I tested. But that errorlevel check syntax you used might be wrong, see http://www.robvanderwoude.com/errorlevel.html I think you need to leave out the ==.
It works same way both ways, with and without '=='.
http://bugs.winehq.org/show_bug.cgi?id=9849
nathan.n saturn_systems@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |saturn_systems@yahoo.com
http://bugs.winehq.org/show_bug.cgi?id=9849
Nicolas Le Cam niko.lecam@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |niko.lecam@gmail.com
--- Comment #5 from Nicolas Le Cam niko.lecam@gmail.com 2009-09-17 15:59:31 --- Tested on Win2K SP4 and WinXP SP3, can't reproduce, it always returns 0. Here is the batch I used :
@echo off foo.exe if ERRORLEVEL 0 goto end echo ERROR :end
http://bugs.winehq.org/show_bug.cgi?id=9849
--- Comment #6 from Dan Kegel dank@kegel.com 2009-09-17 16:05:46 --- the bug is that it always seems to return 0. It should return 1, right?
http://bugs.winehq.org/show_bug.cgi?id=9849
--- Comment #7 from Nicolas Le Cam niko.lecam@gmail.com 2009-09-17 16:25:26 --- Sorry if I wasn't clear, on my boxes (Win2k and WinXP), it also always returns 0, so the result seems correct to me under Wine even if it isn't logic :)
http://bugs.winehq.org/show_bug.cgi?id=9849
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx@gmail.com
--- Comment #8 from Bruno Jesus 00cpxxx@gmail.com 2012-03-14 23:19:34 CDT --- Since dosbox is being used nowadays it always return zero (dosbox window flashes so fast it's not draw as the program is so small).
Is it possible to make dosbox return the application status instead of it's own return?
http://bugs.winehq.org/show_bug.cgi?id=9849
Jerome Leclanche adys.wh@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=9849
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID
--- Comment #9 from Austin English austinenglish@gmail.com --- This isn't reproducible on modern windows, marking invalid unless someone has a testcase that works on Windows and fails on Wine.
https://bugs.winehq.org/show_bug.cgi?id=9849
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Austin English austinenglish@gmail.com --- Closing.