Based upon a patch by Tobias Stoeckmann

1 file changed, 81 deletions(-)
src/main.c |   81 ------------------------------------------------------------


# HG changeset patch
# User John H. Robinson, IV <[email protected]>
# Date 1229207272 28800
# Node ID 473bc8aec019b3b45ff6dee7becb1aa7744951cc
# Parent  41250d373857ffa172a650da675a442576beb93d
Remove unused StartLogShell function.

Based upon a patch by Tobias Stoeckmann

diff --git a/src/main.c b/src/main.c
--- a/src/main.c
+++ b/src/main.c
@@ -320,87 +320,6 @@
         data->command = wstrdup(command);
 
         wAddDeathHandler(pid, (WDeathHandler*)shellCommandHandler, data);
-    }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- * 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];
     }
 }
 

Reply via email to