the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
-#include "config.h"
#include <signal.h>
#include <setjmp.h>
#ifdef HAVE_UNISTD_H
#include "blockinput.h"
#undef NULL
-#ifdef macintosh
+#ifdef MAC_OS8
/* It is essential to include stdlib.h so that this file picks up
the correct definitions of rand, srand, and RAND_MAX.
Otherwise random numbers will not work correctly. */
/* Nonzero means delete a process right away if it exits (process.c). */
static int delete_exited_processes;
#endif
-#endif /* macintosh */
+#endif /* MAC_OS8 */
#ifdef WINDOWSNT
#define read sys_read
#else
#if defined (HAVE_LIBNCURSES) && ! defined (NCURSES_OSPEED_T)
#else
-#if defined (HAVE_TERMIOS_H) && defined (LINUX)
+#if defined (HAVE_TERMIOS_H) && defined (GNU_LINUX)
#include <termios.h>
#endif
#endif
break;
wait (0);
#else /* neither BSD_SYSTEM nor UNIPLUS: random sysV */
-#ifdef POSIX_SIGNALS /* would this work for LINUX as well? */
+#ifdef POSIX_SIGNALS /* would this work for GNU/Linux as well? */
sigblock (sigmask (SIGCHLD));
errno = 0;
if (kill (pid, 0) == -1 && errno == ESRCH)
break;
}
- /* FIXME: Since sigpause is not POSIX and its use is deprecated,
- this should probably be `sigsuspend (&empty_mask)', which is
- POSIX. I'm not making that change right away because the
- release is nearing. 2001-09-20 gerd. */
- sigpause (SIGEMPTYMASK);
+ sigsuspend (&empty_mask);
#else /* not POSIX_SIGNALS */
#ifdef HAVE_SYSV_SIGPAUSE
sighold (SIGCHLD);
#endif
s.main.c_lflag &= ~ECHO; /* Disable echo */
s.main.c_lflag |= ISIG; /* Enable signals */
-#if 0
+#if 0 /* This causes bugs in (for instance) telnet to certain sites. */
s.main.c_iflag &= ~ICRNL; /* Disable map of CR to NL on input */
#ifdef INLCR /* Just being cautious, since I can't check how
widespread INLCR is--rms. */
/* Fork a subshell. */
-#ifndef macintosh
+#ifndef MAC_OS8
void
sys_subshell ()
{
#ifdef SET_EMACS_PRIORITY
{
- extern int emacs_priority;
+ extern EMACS_INT emacs_priority;
if (emacs_priority < 0)
nice (-emacs_priority);
#endif
#ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */
- st = system (sh);
- chdir (oldwd);
+ {
+ char *epwd = getenv ("PWD");
+ char old_pwd[MAXPATHLEN+1+4];
+
+ /* If PWD is set, pass it with corrected value. */
+ if (epwd)
+ {
+ strcpy (old_pwd, epwd);
+ if (str[len - 1] == '/')
+ str[len - 1] = '\0';
+ setenv ("PWD", str, 1);
+ }
+ st = system (sh);
+ chdir (oldwd);
+ if (epwd)
+ putenv (old_pwd); /* restore previous value */
+ }
#if 0 /* This is also reported if last command executed in subshell failed, KFS */
if (st)
report_file_error ("Can't execute subshell", Fcons (build_string (sh), Qnil));
synch_process_alive = 0;
#endif /* !VMS */
}
-#endif /* !macintosh */
+#endif /* !MAC_OS8 */
static void
save_signal_handlers (saved_handlers)
{
struct emacs_tty tty;
-#ifdef macintosh
+#ifdef MAC_OS8
/* cus-start.el complains if delete-exited-processes is not defined */
#ifndef subprocesses
DEFVAR_BOOL ("delete-exited-processes", &delete_exited_processes,
nil means don't delete them until `list-processes' is run. */);
delete_exited_processes = 0;
#endif
-#endif /* not macintosh */
+#endif /* MAC_OS8 */
#ifdef VMS
#if 0
if (c >= 0)
{
struct input_event e;
- e.kind = ascii_keystroke;
+ e.kind = ASCII_KEYSTROKE_EVENT;
XSETINT (e.code, c);
e.frame_or_window = selected_frame;
kbd_buffer_store_event (&e);
if (hp)
{
char *fqdn = (char *) hp->h_name;
+#if 0
char *p;
+#endif
if (!index (fqdn, '.'))
{
kbd_buffer_store_event (&buf[i]);
/* Don't look at input that follows a C-g too closely.
This reduces lossage due to autorepeat on C-g. */
- if (buf[i].kind == ascii_keystroke
+ if (buf[i].kind == ASCII_KEYSTROKE_EVENT
&& buf[i].code == quit_char)
break;
}
nread = read (fileno (stdin), buf, 1);
/* Scan the chars for C-g and store them in kbd_buffer. */
- e.kind = ascii_keystroke;
+ e.kind = ASCII_KEYSTROKE_EVENT;
e.frame_or_window = selected_frame;
e.modifiers = 0;
for (i = 0; i < nread; i++)