From: Eli Zaretskii Date: Sun, 17 Apr 2022 15:45:23 +0000 (+0300) Subject: ; Minor fix for 'restart-emacs' on MS-Windows X-Git-Tag: emacs-29.0.90~1931^2~454 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dd451a37ddf9e1358c56bdb9c65606c1a7967f07;p=emacs.git ; Minor fix for 'restart-emacs' on MS-Windows * src/w32.c (w32_reexec_emacs): Fail if in -nw session. * src/emacs.c (Fkill_emacs): Fix a typo. --- diff --git a/src/emacs.c b/src/emacs.c index 8c897762a2b..fd79963ed9c 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2820,7 +2820,7 @@ killed. */ if (initial_argc < 1) error ("No command line arguments known; unable to re-execute Emacs"); #ifdef WINDOWSNT - if (w32_reexec_emacs (initial_cmdline, initial_wd) < 1) + if (w32_reexec_emacs (initial_cmdline, initial_wd) < 0) #else if (execvp (*initial_argv, initial_argv) < 1) #endif diff --git a/src/w32.c b/src/w32.c index acd7d004e53..ae1d77a021a 100644 --- a/src/w32.c +++ b/src/w32.c @@ -10623,6 +10623,12 @@ realpath (const char *file_name, char *resolved_name) int w32_reexec_emacs (char *cmd_line, const char *wdir) { + if (inhibit_window_system) + { + errno = ENOSYS; + return -1; /* FIXME! */ + } + STARTUPINFO si; SECURITY_ATTRIBUTES sec_attrs; BOOL status;