From 884908a63c624585c9b5fcf22d565236298c2916 Mon Sep 17 00:00:00 2001 From: Roland Mainz Date: Tue, 22 Jun 2004 10:18:13 +0000 Subject: [PATCH] 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. --- Xprint/attributes.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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