summaryrefslogtreecommitdiff
path: root/Xprint
diff options
context:
space:
mode:
authorRoland Mainz <roland.mainz@nrubsig.org>2004-06-22 10:18:13 +0000
committerRoland Mainz <roland.mainz@nrubsig.org>2004-06-22 10:18:13 +0000
commit884908a63c624585c9b5fcf22d565236298c2916 (patch)
tree1a74c22a89fa845bae5479fcb39b1cc6ab9af1d4 /Xprint
parentc66cc2a219e860ae3c0b5d4ad18b22a6dc4e16df (diff)
Fix for http://xprint.freedesktop.org/bugzilla/show_bug.cgi?id=789 : Adding
a workaround for the issue that Xprt may hang when the CUPS spooler frontend sends messages to stdout.
Diffstat (limited to 'Xprint')
-rw-r--r--Xprint/attributes.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Xprint/attributes.c b/Xprint/attributes.c
index 3ad9ceca0..ce386596d 100644
--- a/Xprint/attributes.c
+++ b/Xprint/attributes.c
@@ -1149,11 +1149,17 @@ SendFileToCommand(
if((childPid = fork()) == 0)
{
- close(pipefd[1]);
+ close(pipefd[1]);
+
+ /* Replace current stdin with input from the pipe */
close(0);
dup(pipefd[0]);
close(pipefd[0]);
+ /* Close current stdout and redirect it to stderr */
+ close(1);
+ dup(2);
+
/*
* If a user name is specified, try to set our uid to match that
* user name. This is to allow e.g. a banner page to show the