X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=driver%2Fstderr.c;h=4258f874c5328319df5d886f934dc4d65d58b249;hb=2a991a811de4c7b22f812682b267b616a809fd9a;hp=0743a50e799e58733c2510615001cfb30b5455f5;hpb=481b95e2617b69e6fd4444432747d7e1e0c3dc85;p=xscreensaver diff --git a/driver/stderr.c b/driver/stderr.c index 0743a50e..4258f874 100644 --- a/driver/stderr.c +++ b/driver/stderr.c @@ -1,5 +1,5 @@ /* stderr.c --- capturing stdout/stderr output onto the screensaver window. - * xscreensaver, Copyright (c) 1991-1998 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-1998 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -339,7 +339,7 @@ initialize_stderr (saver_info *si) int stdout_fd = 1; int stderr_fd = 2; int flags = 0; - Boolean stderr_dialog_p, stdout_dialog_p; + Boolean stderr_dialog_p; if (done) return; done = True; @@ -348,9 +348,8 @@ initialize_stderr (saver_info *si) real_stdout = stdout; stderr_dialog_p = get_boolean_resource ("captureStderr", "Boolean"); - stdout_dialog_p = get_boolean_resource ("captureStdout", "Boolean"); - if (!stderr_dialog_p && !stdout_dialog_p) + if (!stderr_dialog_p) return; if (pipe (fds)) @@ -392,6 +391,8 @@ initialize_stderr (saver_info *si) if (stderr_dialog_p) { FILE *new_stderr_file; + FILE *new_stdout_file; + new_stderr = dup (stderr_fd); if (new_stderr < 0) { @@ -411,11 +412,8 @@ initialize_stderr (saver_info *si) perror ("could not dup() a new stderr:"); return; } - } - if (stdout_dialog_p) - { - FILE *new_stdout_file; + new_stdout = dup (stdout_fd); if (new_stdout < 0) {