From 38074e7bd5864e8e16ddafaed1e6e51229218967 Mon Sep 17 00:00:00 2001 From: "John H. Robinson, IV" Date: Sat, 13 Dec 2008 14:44:59 -0800 Subject: [PATCH] Remove unused StartLogShell function. Based upon a patch by Tobias Stoeckmann Small code size reduction, text data bss dec hex filename 620412 19144 8544 648100 9e3a4 src/.libs/wmaker 621347 19152 8544 649043 9e753 src/.libs/wmaker.old --- src/main.c | 81 ------------------------------------------------------ 1 file changed, 81 deletions(-) diff --git a/src/main.c b/src/main.c index 6441c8d7..d61fda2e 100644 --- a/src/main.c +++ b/src/main.c @@ -328,87 +328,6 @@ ExecuteShellCommand(WScreen *scr, char *command) } -/* - *--------------------------------------------------------------------------- - * StartLogShell - * Start a shell that will receive all stdin and stdout from processes - * forked by wmaker. - *--------------------------------------------------------------------------- - */ -void -StartLogShell(WScreen *scr) -{ - int in_fd[2]; - int out_fd[2]; - int err_fd[2]; - pid_t pid; - - SetupEnvironment(scr); - - if (pipe(in_fd) < 0) { - wsyserror("could not create pipe for log shell\n"); - return; - } - if (pipe(out_fd) < 0) { - wsyserror("could not create pipe for log shell\n"); - close(in_fd[0]); - close(in_fd[1]); - return; - } - if (pipe(err_fd) < 0) { - wsyserror("could not create pipe for log shell\n"); - close(out_fd[0]); - close(out_fd[1]); - close(in_fd[0]); - close(in_fd[1]); - return; - } - - pid = fork(); - if (pid < 0) { - wsyserror("could not fork a new process for log shell\n"); - return; - } else if (pid == 0) { - close(in_fd[0]); - close(out_fd[1]); - close(err_fd[1]); - - close(0); - close(1); - close(2); - - if (dup2(in_fd[1], 0) < 0) { - wsyserror("could not redirect stdin for log shell\n"); - exit(1); - } - if (dup2(out_fd[1], 1) < 0) { - wsyserror("could not redirect stdout for log shell\n"); - exit(1); - } - if (dup2(err_fd[1], 2) < 0) { - wsyserror("could not redirect stderr for log shell\n"); - exit(1); - } - - close(in_fd[1]); - close(out_fd[1]); - close(err_fd[1]); - - execl("/bin/sh", "/bin/sh", "-c", wPreferences.logger_shell, NULL); - wsyserror("could not execute %s\n", wPreferences.logger_shell); - exit(1); - } else { - close(in_fd[1]); - close(out_fd[0]); - close(err_fd[0]); - - LogStdIn = in_fd[1]; - LogStdOut = out_fd[0]; - LogStdErr = err_fd[0]; - } -} - - /* *--------------------------------------------------------------------- * wAbort--