[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[h-e-w] emacsclientw.exe bug: random exit status
From: |
Gary Oberbrunner |
Subject: |
[h-e-w] emacsclientw.exe bug: random exit status |
Date: |
Thu, 24 Sep 2009 18:04:11 -0400 (EDT) |
emacsclientw exits with a random exit status when called from a win32 window
app (such as emacs itself). The reason is an uninitialized variable in
w32_teardown_window in w32emacsclient.h. I suspect if "ret" is initialized to
zero (exit status success) in this function it would just work. I don't have
mingw so I can't compile it here myself, sorry.
This is on emacs 23.1.50, also happens on the latest CVS test version. I'm
using the EmacsW32 patched version on XP, but don't think that matters either.
The symptom is easy to reproduce. In a shell window inside emacs (I use cygwin
zsh, but any shell will work), run
emacsclient foo || echo BAD
then C-x # to close the server buffer, and then look back in the shell window:
% emacsclientw foo || echo BAD
Waiting for Emacs...
BAD
%
(I'm sure you already know that "emacsclient", the non-windows version, is
totally broken, gives "Unknown&_command:&"... but emacsclientw is fine so it
doesn't really matter.)
Here's the affected code:
===========
int
w32_teardown_window (int connected)
{
int ret; <<<<<<<<<<====== FIX HERE to int ret=0;
if (w32_window_app ())
{
w32_check_not_synced();
w32_wait_threads_fin(connected);
ret = W32_SYNC_get_g_exit_value();
DeleteCriticalSection(&g_cs.cs);
return ret;
}
else
ret = g_exit_value;
return ret;
}
============
--
. . . . . . . . . . . . . . . . . . . . . . . . .
Gary Oberbrunner address@hidden
GenArts, Inc. Tel: 617-492-2888
955 Mass. Ave Fax: 617-492-2852
Cambridge, MA 02139 USA www.genarts.com
- [h-e-w] emacsclientw.exe bug: random exit status,
Gary Oberbrunner <=