Mail Archives: djgpp/1996/06/04/01:42:14
On Mon, 3 Jun 1996, Robert Jaycocks wrote:
> Has anyone managed to get emacs19.31 compiled under DJGPPv2. I've
> compiled it, but for some reason the Shell command is not working.
> When I perform a Shell command (using ESC !), the following is
> printed in the mini-buffer
>
> Searching for program: permission denied (EACCES), c:/command.com
This is due to a bug in the library function `_is_executable' which was
reported a couple of months ago to the DJGPP bug-tracking system. To
correct it, apply the patch below to the file
src/libc/posix/sys/stat/is_exec.c, compile it and put it into libc.a;
then rebuild Emacs.
There is one other library bug that should be visible when linking Emacs
19.31 with stock libc.a: after you shell to DOS, Ctrl-Break kills Emacs.
Below I attach a patch to the library function `sigaction' that should
correct this problem.
*** posix/sys/stat/is_exec.c~0 Sun Nov 12 23:22:48 1995
--- posix/sys/stat/is_exec.c Sat Apr 6 13:09:48 1996
***************
*** 18,23 ****
--- 18,24 ----
#include <libc/stubs.h>
#include <stdio.h>
#include <string.h>
+ #include <ctype.h>
#include <errno.h>
#include <dpmi.h>
#include <go32.h>
***************
*** 182,192 ****
&& strlen(extension) <= ((extension[0]=='.') ? 4 : 3))
{
/* Search the list of extensions in executables[]. */
! char tmp_buf[6];
! tmp_buf[0] = '|';
! strcpy(tmp_buf+1, *extension == '.' ? extension + 1 : extension);
! strcat(tmp_buf, "|");
if (strstr(non_executables, tmp_buf))
return 0;
else if (strstr(executables, tmp_buf))
--- 183,197 ----
&& strlen(extension) <= ((extension[0]=='.') ? 4 : 3))
{
/* Search the list of extensions in executables[]. */
! char tmp_buf[6], *tp = tmp_buf;
! *tp++ = '|';
! if (*extension == '.')
! extension++;
! while (*extension)
! *tp++ = toupper (*extension++);
! *tp++ = '|';
! *tp = '\0';
if (strstr(non_executables, tmp_buf))
return 0;
else if (strstr(executables, tmp_buf))
*** posix/signal/sigactio.c~0 Sun Apr 2 01:11:10 1995
--- posix/signal/sigactio.c Thu Apr 4 19:50:18 1996
***************
*** 1,19 ****
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <signal.h>
int
sigaction(int _sig, const struct sigaction *_act, struct sigaction *_oact)
{
if (_oact)
{
/* FIXME */
! _oact->sa_handler = SIG_DFL;
! sigemptyset(&_oact->sa_mask);
_oact->sa_flags = 0;
}
if (_act)
{
! signal(_sig, _act->sa_handler);
}
! return 0;
}
--- 1,35 ----
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <signal.h>
+ #include <errno.h>
int
sigaction(int _sig, const struct sigaction *_act, struct sigaction *_oact)
{
+ int retval = 0;
+
if (_oact)
{
+ void (*installed_sig)(int) = signal (_sig, SIG_IGN);
+
/* FIXME */
! if (installed_sig == SIG_ERR)
! {
! retval = -1;
! errno = EINVAL;
! }
! else
! signal (_sig, installed_sig);
! _oact->sa_handler = installed_sig;
! retval = sigemptyset(&_oact->sa_mask);
_oact->sa_flags = 0;
}
if (_act)
{
! if (signal(_sig, _act->sa_handler) == SIG_ERR)
! {
! retval = -1;
! errno = EINVAL;
! }
}
! return retval;
}
- Raw text -