* gutil.c (port_shutdown_extra_fds): Remove, it's unused.
(exec_direct): Likewise. * gconf.h: Remove declaration of port_shutdown_extra_fds().
Этот коммит содержится в:
родитель
f952acf1f8
Коммит
f1984dd70d
@ -1,5 +1,9 @@
|
||||
2001-07-16 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* gutil.c (port_shutdown_extra_fds): Remove, it's unused.
|
||||
(exec_direct): Likewise.
|
||||
* gconf.h: Remove declaration of port_shutdown_extra_fds().
|
||||
|
||||
* gfind.c: Move most static variables to a structure, use it
|
||||
in signal callbacks. All dependencies adjusted. Don't truncate
|
||||
filenames.
|
||||
|
@ -45,5 +45,4 @@
|
||||
#define mi_getch() fprintf (stderr, "mi_getch is not implemented in this port\n")
|
||||
#define frontend_run_dlg(x) gtkrundlg_event (x)
|
||||
|
||||
void port_shutdown_extra_fds(void);
|
||||
void x_flush_events (void);
|
||||
|
@ -208,52 +208,3 @@ int my_system (int flags, const char *shell, const char *command)
|
||||
|
||||
return my_system_get_child_pid (flags, shell, command, &pid);
|
||||
}
|
||||
|
||||
int
|
||||
exec_direct (char *path, char *argv [])
|
||||
{
|
||||
struct sigaction ignore, save_intr, save_quit, save_stop;
|
||||
pid_t pid;
|
||||
int status = 0, i;
|
||||
|
||||
ignore.sa_handler = SIG_IGN;
|
||||
sigemptyset (&ignore.sa_mask);
|
||||
ignore.sa_flags = 0;
|
||||
|
||||
sigaction (SIGINT, &ignore, &save_intr);
|
||||
sigaction (SIGQUIT, &ignore, &save_quit);
|
||||
|
||||
if ((pid = fork ()) < 0){
|
||||
fprintf (stderr, "\n\nfork () = -1\n");
|
||||
return -1;
|
||||
}
|
||||
if (pid == 0){
|
||||
sigaction (SIGINT, &save_intr, NULL);
|
||||
sigaction (SIGQUIT, &save_quit, NULL);
|
||||
|
||||
for (i = 3; i < 4096; i++)
|
||||
close (i);
|
||||
|
||||
execvp (path, argv);
|
||||
_exit (127); /* Exec error */
|
||||
}
|
||||
sigaction (SIGINT, &save_intr, NULL);
|
||||
sigaction (SIGQUIT, &save_quit, NULL);
|
||||
sigaction (SIGTSTP, &save_stop, NULL);
|
||||
|
||||
#ifdef SCO_FLAVOR
|
||||
waitpid(-1, NULL, WNOHANG);
|
||||
#endif /* SCO_FLAVOR */
|
||||
|
||||
return WEXITSTATUS(status);
|
||||
}
|
||||
|
||||
void
|
||||
port_shutdown_extra_fds (void)
|
||||
{
|
||||
const int top = max_open_files ();
|
||||
int f;
|
||||
|
||||
for (f = 0; f < top; f++)
|
||||
close (f);
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user