From ff2c7ce0e4a24000c8556172632571f764673889 Mon Sep 17 00:00:00 2001 From: "caillon%returnzero.com" Date: Thu, 4 Apr 2002 11:29:38 +0000 Subject: [PATCH] Bug 134570, 'Print to file' not working with threaded XprintUtil. Patch by Roland.Mainz@informatik.med.uni-giessen.de, r=cbiesinger@web.de, sr=attinasi, a=asa. --- gfx/src/xprint/xprintutil.h | 6 +++++- gfx/src/xprint/xprintutil_printtofile.c | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gfx/src/xprint/xprintutil.h b/gfx/src/xprint/xprintutil.h index 81fdba2c22bf..4929db91e771 100644 --- a/gfx/src/xprint/xprintutil.h +++ b/gfx/src/xprint/xprintutil.h @@ -48,7 +48,11 @@ #include #include #define XPU_USE_NSPR 1 -#define XPU_USE_THREADS 1 +/* + * Disabled for now - Threaded codepath does not work properly always. + * See bug 134570 ("Print-to-file not working with threaded XprintUtil") + * #define XPU_USE_THREADS 1 + */ #endif /* USE_MOZILLA_TYPES */ #ifdef DEBUG diff --git a/gfx/src/xprint/xprintutil_printtofile.c b/gfx/src/xprint/xprintutil_printtofile.c index 9fb06817fc85..0a0e63d82ab6 100644 --- a/gfx/src/xprint/xprintutil_printtofile.c +++ b/gfx/src/xprint/xprintutil_printtofile.c @@ -357,11 +357,11 @@ void *XpuPrintToFile( Display *pdpy, XPContext pcontext, const char *filename ) XPGetDocStatus XpuWaitForPrintFileChild( void *handle ) { MyPrintFileData *mpfd = (MyPrintFileData *)handle; - siginfo_t res; + int res; XPGetDocStatus status = XPGetDocError; /* used when read() from pipe fails */ - if( XPU_TRACE(waitid(P_PID, mpfd->pid, &res, WEXITED)) == -1 ) - perror("XpuWaitForPrintFileChild: waitid failure"); + if( XPU_TRACE(waitpid(mpfd->pid, &res, 0)) == -1 ) + perror("XpuWaitForPrintFileChild: waitpid failure"); /* read the status from the child */ if( read(mpfd->pipe[0], &status, sizeof(XPGetDocStatus)) != sizeof(XPGetDocStatus) )