GNU bug report logs - #6430
Emacs WINDOWS truncates exit status of processes to 8 bits

Previous Next

Package: emacs;

Reported by: macross84 <at> ozu.es

Date: Tue, 15 Jun 2010 17:29:01 UTC

Severity: wishlist

Tags: wontfix

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


Message #31 received at 6430 <at> debbugs.gnu.org (full text, mbox):

From: Óscar Fuentes <ofv <at> wanadoo.es>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: macross84 <at> ozu.es, 6430 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
Subject: Re: bug#6430: Emacs WINDOWS truncates exit status of processes to 8
 bits
Date: Wed, 15 Jun 2016 17:15:54 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> When a Windows application calls an API that fails and the application
>> has no method for recovering from the error, it is customary to exit
>> with the error code of the API (usually obtained with GetLastError).
>
> GetLastError has nothing to do with this, because it's not an API that
> fails, it's a program that exits with some arbitrary exit code.

if( ! CreateProcess(....) ) {
  DWORD ec = GetLastError();
  // do some cleanup
  ExitProcess(ec);
}
  
The program exits with the error code obtained with GetLastError, which
is a 32 bit number.

The program may have its own exit codes, which can be wider than 8 bits.




This bug report was last modified 4 years and 187 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.