Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!think.com!mintaka!mit-eddie!uw-beaver!ubc-cs!alberta!herald.usask.ca!ccu.umanitoba.ca!umrobbin From: umrobbin@ccu.umanitoba.ca Newsgroups: comp.sys.amiga.programmer Subject: What's wrong with negative return values? Message-ID: <1991Mar22.080144.23112@ccu.umanitoba.ca> Date: 22 Mar 91 08:01:44 GMT Organization: University of Manitoba, Winnipeg, Canada Lines: 24 Okay, stupid question time: If I run this program: main(){ printf("Goodbye cruel world\n"); exit(-1); } funny things happen. Under amigados, the program runs once, and then the disk spins again and gives a random AmigaDOS error. Under the CShell, the program executes twice! Also, if the return value is -2 or -3, the AmigaDOS CLI doesn't give any error (and runs once) but cshell still executes it twice. And for any negative value, the cshell variable _lasterr is always 20. What's up? The CLI is Amigados 1.3, and the cshell is "Shell V4.02A" by Dillon, Drew, Borreo & Dieni. Steve Z .