#ifdef WINDOWSNT
pid = -1;
#else /* not WINDOWSNT */
+#ifdef MSDOS
+ pid = 0;
+#else
pid = vfork ();
-
if (pid == -1)
error ("Can't spawn subshell");
+#endif
+
if (pid == 0)
#endif /* not WINDOWSNT */
{
- char *sh;
+ char *sh = 0;
#ifdef MSDOS /* MW, Aug 1993 */
getwd (oldwd);
+ if (sh == 0)
+ sh = (char *) egetenv ("SUSPEND"); /* KFS, 1994-12-14 */
#endif
- sh = (char *) egetenv ("SHELL");
+ if (sh == 0)
+ sh = (char *) egetenv ("SHELL");
if (sh == 0)
sh = "sh";
#ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */
st = system (sh);
chdir (oldwd);
+#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));
+#endif
#else /* not MSDOS */
#ifdef WINDOWSNT
/* Waits for process completion */
save_signal_handlers (saved_handlers);
synch_process_alive = 1;
+#ifndef MSDOS
wait_for_termination (pid);
+#endif
restore_signal_handlers (saved_handlers);
#endif /* !VMS */
}
#else
setbuf (stdout, _sobuf);
#endif
+#ifdef HAVE_X_WINDOWS
+ /* Emacs' window system on MSDOG uses the `internal terminal' and therefore
+ needs the initialization code below. */
if (! read_socket_hook && EQ (Vwindow_system, Qnil))
+#endif
set_terminal_modes ();
if (term_initted && no_redraw_on_reenter)
return;
#endif
cursor_to (FRAME_HEIGHT (selected_frame) - 1, 0);
-#ifdef MSDOS
- if (!EQ (Vwindow_system, Qnil))
- {
- /* Change to grey on white. */
- putchar ('\e');
- putchar ('A');
- putchar (7);
- }
-#endif
clear_end_of_line (FRAME_WIDTH (selected_frame));
/* clear_end_of_line may move the cursor */
cursor_to (FRAME_HEIGHT (selected_frame) - 1, 0);
}
if (hp)
{
- char *fqdn = hp->h_name;
+ char *fqdn = (char *) hp->h_name;
char *p;
if (!index (fqdn, '.'))
}
}
\f
+#ifndef MSDOS
#ifndef VMS
#if !defined (HAVE_SELECT) || defined (BROKEN_SELECT_NON_X)
#ifdef FIONREAD
status = ioctl (fd, FIONREAD, &avail);
#else /* no FIONREAD */
-#ifdef MSDOS
- abort (); /* I don't think we need it. */
-#else /* not MSDOS */
/* Hoping it will return -1 if nothing available
or 0 if all 0 chars requested are read. */
if (proc_buffered_char[fd] >= 0)
if (avail > 0)
proc_buffered_char[fd] = buf;
}
-#endif /* not MSDOS */
#endif /* no FIONREAD */
}
if (status >= 0 && avail > 0)
while (select_alarmed == 0 && *local_timeout != 0
&& process_tick == update_tick)
{
-#ifdef MSDOS
- sleep_or_kbd_hit (SELECT_PAUSE, FD_ISSET (0, &orfds) != 0);
- select_alarm ();
-#else /* not MSDOS */
/* If we are interested in terminal input,
wait by reading the terminal.
That makes instant wakeup for terminal input at least. */
}
else
pause ();
-#endif /* not MSDOS */
}
(*local_timeout) -= SELECT_PAUSE;
/* Reset the old alarm if there was one */
#endif /* not HAVE_SELECT */
#endif /* not VMS */
+#endif /* not MSDOS */
\f
#ifdef BSD4_1
/*
sys_close (fd)
int fd;
{
+ int did_retry = 0;
register int rtnval;
while ((rtnval = close (fd)) == -1
- && (errno == EINTR));
+ && (errno == EINTR))
+ did_retry = 1;
+
+ /* If close is interrupted SunOS 4.1 may or may not have closed the
+ file descriptor. If it did the second close will fail with
+ errno = EBADF. That means we have succeeded. */
+ if (rtnval == -1 && did_retry && errno == EBADF)
+ return 0;
+
return rtnval;
}
dup2 (fd, 1);
dup2 (fd, 2);
}
- wait_for_termination (cpid);
- if (synch_process_death != 0 || synch_process_retcode != 0)
- return -1; /* /bin/rmdir failed */
+ execl ("/bin/rmdir", "rmdir", dpath, (char *) 0);
+ _exit (-1); /* Can't exec /bin/rmdir */
+
default: /* Parent process */
- while (cpid != wait (&status)); /* Wait for kid to finish */
+ wait_for_termination (cpid);
}
- if (WIFSIGNALED (status) || WEXITSTATUS (status) != 0)
+ if (synch_process_death != 0 || synch_process_retcode != 0)
{
errno = EIO; /* We don't know why, but */
- return -1; /* /bin/mkdir failed */
+ return -1; /* /bin/rmdir failed */
}
return 0;