bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6430: Emacs WINDOWS truncates exit status of processes to 8 bits


From: Óscar Fuentes
Subject: bug#6430: Emacs WINDOWS truncates exit status of processes to 8 bits
Date: Wed, 15 Jun 2016 19:14:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> > 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);
>> }
>
> That's not how Emacs does that, see waitpid and its callers.

Once again, we are miscommunicating. AFAIU this is about Emacs calling a
process foo which returns an exit code larger than 255, but Emacs only
reports the lower 8 bits to the Elisp function that started the process.

In w32proc.c waitpid:

  if (!GetExitCodeProcess (wait_hnd[active], &retval))
  ...
  retval <<= 8;

Windows applications make use of the full 32 bits of the return code.
With Emacs it is impossible to know those larger-than-255 exit codes.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]