From 1b044baeebfcadaa8c3fb01d5b612848df015c8e Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 25 Jan 2010 10:35:39 +0000 Subject: [PATCH] - Fixed pdftoraster so that it waits for its sub-process to exit. - Another gdevcups duplex fix from upstream revision 10631 (bug #541604). --- ghostscript-gdevcups-y-axis.patch | 143 ++++++++++++++++------------- ghostscript-pdftoraster-exit.patch | 39 ++++++++ ghostscript.spec | 11 ++- 3 files changed, 126 insertions(+), 67 deletions(-) create mode 100644 ghostscript-pdftoraster-exit.patch diff --git a/ghostscript-gdevcups-y-axis.patch b/ghostscript-gdevcups-y-axis.patch index 6e92ca1..39aafa9 100644 --- a/ghostscript-gdevcups-y-axis.patch +++ b/ghostscript-gdevcups-y-axis.patch @@ -1,6 +1,6 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/gdevcups.c ---- ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis 2010-01-21 11:17:55.974149011 +0000 -+++ ghostscript-8.70/cups/gdevcups.c 2010-01-21 11:18:54.823149257 +0000 +--- ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis 2010-01-25 08:34:15.197084192 +0000 ++++ ghostscript-8.70/cups/gdevcups.c 2010-01-25 08:34:21.603208913 +0000 @@ -605,8 +605,6 @@ private void cups_get_matrix(gx_device *pdev, /* I - Device info */ gs_matrix *pmat) /* O - Physical transform matrix */ @@ -141,7 +141,17 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ pmat->xx = (float)cups->header.HWResolution[0] / 72.0; pmat->xy = 0.0; pmat->yx = 0.0; -@@ -2799,6 +2703,7 @@ cups_put_params(gx_device *pdev, /* +@@ -2792,13 +2696,16 @@ cups_put_params(gx_device *pdev, /* + int color_set; /* Were the color attrs set? */ + gdev_prn_space_params sp; /* Space parameter data */ + int width, /* New width of page */ +- height; /* New height of page */ ++ height; /* New height of page */ ++ static int width_old = 0, /* Previous width */ ++ height_old = 0; /* Previous height */ + ppd_attr_t *backside = NULL, + *backsiderequiresflippedmargins = NULL; + float swap; int xflip = 0, yflip = 0; int found = 0; @@ -149,32 +159,22 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ dprintf2("DEBUG2: cups_put_params(%p, %p)\n", pdev, plist); -@@ -2895,6 +2800,15 @@ cups_put_params(gx_device *pdev, /* - size_set = param_read_float_array(plist, ".MediaSize", &arrayval) == 0 || - param_read_float_array(plist, "PageSize", &arrayval) == 0; +@@ -2897,6 +2804,14 @@ cups_put_params(gx_device *pdev, /* margins_set = param_read_float_array(plist, "Margins", &arrayval) == 0; + color_set = param_read_int(plist, "cupsColorSpace", &intval) == 0 || + param_read_int(plist, "cupsBitsPerColor", &intval) == 0; + /* We also recompute page size and margins if we simply get onto a new + page without necessarily having a page size change in the PostScript + code, as for some printers margins have to flipped on the back sides of + the sheets (even pages) when printing duplex */ + if (cups->page != lastpage) { + size_set = 1; -+ margins_set = 1; + lastpage = cups->page; + } - color_set = param_read_int(plist, "cupsColorSpace", &intval) == 0 || - param_read_int(plist, "cupsBitsPerColor", &intval) == 0; -@@ -2995,7 +2909,7 @@ cups_put_params(gx_device *pdev, /* - * Update margins/sizes as needed... - */ - -- if (size_set) -+ if (size_set || margins_set) - { - /* - * Compute the page margins... -@@ -3011,6 +2925,7 @@ cups_put_params(gx_device *pdev, /* + stringoption(MediaClass, "MediaClass") + stringoption(MediaColor, "MediaColor") +@@ -3011,6 +2926,7 @@ cups_put_params(gx_device *pdev, /* if (cupsPPD != NULL) { dprintf1("DEBUG2: cups->header.Duplex = %d\n", cups->header.Duplex); @@ -182,7 +182,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ dprintf1("DEBUG2: cups->page = %d\n", cups->page); dprintf1("DEBUG2: cupsPPD = %p\n", cupsPPD); -@@ -3034,10 +2949,13 @@ cups_put_params(gx_device *pdev, /* +@@ -3034,10 +2950,13 @@ cups_put_params(gx_device *pdev, /* { xflip = 1; if (backsiderequiresflippedmargins && @@ -198,7 +198,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ } else if (cups->header.Duplex && (!cups->header.Tumble && -@@ -3046,10 +2964,13 @@ cups_put_params(gx_device *pdev, /* +@@ -3046,10 +2965,13 @@ cups_put_params(gx_device *pdev, /* { xflip = 0; if (backsiderequiresflippedmargins && @@ -214,7 +214,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ } else if (cups->header.Duplex && ((!cups->header.Tumble && -@@ -3061,13 +2982,17 @@ cups_put_params(gx_device *pdev, /* +@@ -3061,13 +2983,17 @@ cups_put_params(gx_device *pdev, /* { xflip = 1; if (backsiderequiresflippedmargins && @@ -234,7 +234,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ xflip = 0; yflip = 0; } -@@ -3104,9 +3029,20 @@ cups_put_params(gx_device *pdev, /* +@@ -3104,9 +3030,20 @@ cups_put_params(gx_device *pdev, /* ((strlen(cups->header.cupsPageSizeName) == 0) || (strcasecmp(cups->header.cupsPageSizeName, size->name) == 0)) && #endif @@ -257,7 +257,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ break; if (i > 0) -@@ -3148,9 +3084,20 @@ cups_put_params(gx_device *pdev, /* +@@ -3148,9 +3085,20 @@ cups_put_params(gx_device *pdev, /* ((strlen(cups->header.cupsPageSizeName) == 0) || (strcasecmp(cups->header.cupsPageSizeName, size->name) == 0)) && #endif @@ -280,16 +280,27 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ break; if (i > 0) -@@ -3258,7 +3205,7 @@ cups_put_params(gx_device *pdev, /* - * Reallocate memory if the size or color depth was changed... - */ +@@ -3290,12 +3238,17 @@ cups_put_params(gx_device *pdev, /* -- if (color_set || size_set) -+ if (color_set || size_set || margins_set) - { /* - * Make sure the page image is the correct size - current Ghostscript -@@ -3769,13 +3716,22 @@ cups_print_chunked(gx_device_printer *pd + * Don't reallocate memory unless the device has been opened... ++ * Also reallocate only if the size has actually changed... + */ + +- if (pdev->is_open) ++ if (pdev->is_open && (width != width_old || height != height_old)) + { ++ ++ width_old = width; ++ height_old = height; ++ + /* +- * Device is open, so reallocate... ++ * Device is open and size has changed, so reallocate... + */ + + dprintf4("DEBUG2: Reallocating memory, [%.0f %.0f] = %dx%d pixels...\n", +@@ -3769,13 +3722,22 @@ cups_print_chunked(gx_device_printer *pd unsigned char *srcptr, /* Pointer to data */ *dstptr; /* Pointer to bits */ int count; /* Count for loop */ @@ -314,7 +325,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ } if (cups->header.Duplex && cupsPPD && ((!cups->header.Tumble && -@@ -3785,19 +3741,36 @@ cups_print_chunked(gx_device_printer *pd +@@ -3785,19 +3747,36 @@ cups_print_chunked(gx_device_printer *pd (backside && (!strcasecmp(backside->value, "Flipped") || !strcasecmp(backside->value, "ManualTumble"))))) && !(cups->page & 1)) @@ -357,7 +368,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ { /* * Grab the scanline data... -@@ -3809,7 +3782,7 @@ cups_print_chunked(gx_device_printer *pd +@@ -3809,7 +3788,7 @@ cups_print_chunked(gx_device_printer *pd gs_exit(gs_lib_ctx_get_non_gc_memory_t(), 1); } @@ -366,7 +377,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ { /* * Flip the raster data before writing it... -@@ -3963,13 +3936,22 @@ cups_print_banded(gx_device_printer *pde +@@ -3963,13 +3942,22 @@ cups_print_banded(gx_device_printer *pde unsigned char *srcptr; /* Pointer to data */ unsigned char *cptr, *mptr, *yptr, /* Pointer to components */ *kptr, *lcptr, *lmptr; /* ... */ @@ -391,7 +402,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ } if (cups->header.Duplex && cupsPPD && ((!cups->header.Tumble && -@@ -3979,12 +3961,30 @@ cups_print_banded(gx_device_printer *pde +@@ -3979,12 +3967,30 @@ cups_print_banded(gx_device_printer *pde (backside && (!strcasecmp(backside->value, "Flipped") || !strcasecmp(backside->value, "ManualTumble"))))) && !(cups->page & 1)) @@ -426,7 +437,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ /* * Loop through the page bitmap and write banded pixels... We have -@@ -4001,7 +4001,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4001,7 +4007,7 @@ cups_print_banded(gx_device_printer *pde bandbytes = cups->header.cupsBytesPerLine / cups->color_info.num_components; #endif /* CUPS_RASTER_SYNCv1 */ @@ -435,7 +446,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ { /* * Grab the scanline data... -@@ -4021,7 +4021,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4021,7 +4027,7 @@ cups_print_banded(gx_device_printer *pde memset(dst, 0, cups->header.cupsBytesPerLine); else { @@ -444,7 +455,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ cptr = dst + bandbytes - 1; else cptr = dst; -@@ -4040,7 +4040,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4040,7 +4046,7 @@ cups_print_banded(gx_device_printer *pde switch (cups->header.cupsColorSpace) { default : @@ -453,7 +464,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ x > 0; x --, srcptr ++) { -@@ -4051,7 +4051,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4051,7 +4057,7 @@ cups_print_banded(gx_device_printer *pde if (*srcptr & 0x10) *yptr |= bit; @@ -462,7 +473,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ { if (bit < 128) bit <<= 1; -@@ -4077,7 +4077,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4077,7 +4083,7 @@ cups_print_banded(gx_device_printer *pde if (*srcptr & 0x1) *yptr |= bit; @@ -471,7 +482,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ { if (bit < 128) bit <<= 1; -@@ -4107,7 +4107,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4107,7 +4113,7 @@ cups_print_banded(gx_device_printer *pde case CUPS_CSPACE_CMYK : case CUPS_CSPACE_YMCK : case CUPS_CSPACE_KCMY : @@ -480,7 +491,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ x > 0; x --, srcptr ++) { -@@ -4120,7 +4120,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4120,7 +4126,7 @@ cups_print_banded(gx_device_printer *pde if (*srcptr & 0x10) *kptr |= bit; @@ -489,7 +500,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ { if (bit < 128) bit <<= 1; -@@ -4149,7 +4149,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4149,7 +4155,7 @@ cups_print_banded(gx_device_printer *pde if (*srcptr & 0x1) *kptr |= bit; @@ -498,7 +509,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ { if (bit < 128) bit <<= 1; -@@ -4175,7 +4175,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4175,7 +4181,7 @@ cups_print_banded(gx_device_printer *pde } break; case CUPS_CSPACE_KCMYcm : @@ -507,7 +518,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ x > 0; x --, srcptr ++) { -@@ -4198,7 +4198,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4198,7 +4204,7 @@ cups_print_banded(gx_device_printer *pde if (*srcptr & 0x01) *lmptr |= bit; @@ -516,7 +527,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ { if (bit < 128) bit <<= 1; -@@ -4236,7 +4236,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4236,7 +4242,7 @@ cups_print_banded(gx_device_printer *pde switch (cups->header.cupsColorSpace) { default : @@ -525,7 +536,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ x > 0; x --, srcptr ++) switch (bit) -@@ -4249,7 +4249,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4249,7 +4255,7 @@ cups_print_banded(gx_device_printer *pde if ((temp = *srcptr & 0x03) != 0) *yptr |= temp << 6; @@ -534,7 +545,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ { bit = 0x03; cptr --; -@@ -4267,7 +4267,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4267,7 +4273,7 @@ cups_print_banded(gx_device_printer *pde if ((temp = *srcptr & 0x03) != 0) *yptr |= temp << 4; @@ -543,7 +554,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ bit = 0xc0; else bit = 0x0c; -@@ -4280,7 +4280,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4280,7 +4286,7 @@ cups_print_banded(gx_device_printer *pde if ((temp = *srcptr & 0x03) != 0) *yptr |= temp << 2; @@ -552,7 +563,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ bit = 0x30; else bit = 0x03; -@@ -4293,7 +4293,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4293,7 +4299,7 @@ cups_print_banded(gx_device_printer *pde if ((temp = *srcptr & 0x03) != 0) *yptr |= temp; @@ -561,7 +572,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ bit = 0x0c; else { -@@ -4313,7 +4313,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4313,7 +4319,7 @@ cups_print_banded(gx_device_printer *pde case CUPS_CSPACE_YMCK : case CUPS_CSPACE_KCMY : case CUPS_CSPACE_KCMYcm : @@ -570,7 +581,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ x > 0; x --, srcptr ++) switch (bit) -@@ -4328,7 +4328,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4328,7 +4334,7 @@ cups_print_banded(gx_device_printer *pde if ((temp = *srcptr & 0x03) != 0) *kptr |= temp << 6; @@ -579,7 +590,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ { bit = 0x03; cptr --; -@@ -4349,7 +4349,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4349,7 +4355,7 @@ cups_print_banded(gx_device_printer *pde if ((temp = *srcptr & 0x03) != 0) *kptr |= temp << 4; @@ -588,7 +599,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ bit = 0xc0; else bit = 0x0c; -@@ -4364,7 +4364,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4364,7 +4370,7 @@ cups_print_banded(gx_device_printer *pde if ((temp = *srcptr & 0x03) != 0) *kptr |= temp << 2; @@ -597,7 +608,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ bit = 0x30; else bit = 0x03; -@@ -4379,7 +4379,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4379,7 +4385,7 @@ cups_print_banded(gx_device_printer *pde if ((temp = *srcptr & 0x03) != 0) *kptr |= temp; @@ -606,7 +617,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ bit = 0x0c; else { -@@ -4401,7 +4401,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4401,7 +4407,7 @@ cups_print_banded(gx_device_printer *pde switch (cups->header.cupsColorSpace) { default : @@ -615,7 +626,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ x > 0; x --, srcptr += 2) switch (bit) -@@ -4416,7 +4416,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4416,7 +4422,7 @@ cups_print_banded(gx_device_printer *pde bit = 0x0f; @@ -624,7 +635,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ { cptr --; mptr --; -@@ -4433,7 +4433,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4433,7 +4439,7 @@ cups_print_banded(gx_device_printer *pde bit = 0xf0; @@ -633,7 +644,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ { cptr ++; mptr ++; -@@ -4450,7 +4450,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4450,7 +4456,7 @@ cups_print_banded(gx_device_printer *pde case CUPS_CSPACE_YMCK : case CUPS_CSPACE_KCMY : case CUPS_CSPACE_KCMYcm : @@ -642,7 +653,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ x > 0; x --, srcptr += 2) switch (bit) -@@ -4467,7 +4467,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4467,7 +4473,7 @@ cups_print_banded(gx_device_printer *pde bit = 0x0f; @@ -651,7 +662,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ { cptr --; mptr --; -@@ -4487,7 +4487,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4487,7 +4493,7 @@ cups_print_banded(gx_device_printer *pde bit = 0xf0; @@ -660,7 +671,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ { cptr ++; mptr ++; -@@ -4504,7 +4504,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4504,7 +4510,7 @@ cups_print_banded(gx_device_printer *pde switch (cups->header.cupsColorSpace) { default : @@ -669,7 +680,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ for (x = cups->width; x > 0; x --) { *cptr-- = *srcptr++; -@@ -4527,7 +4527,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4527,7 +4533,7 @@ cups_print_banded(gx_device_printer *pde case CUPS_CSPACE_YMCK : case CUPS_CSPACE_KCMY : case CUPS_CSPACE_KCMYcm : @@ -678,7 +689,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ for (x = cups->width; x > 0; x --) { *cptr-- = *srcptr++; -@@ -4551,7 +4551,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4551,7 +4557,7 @@ cups_print_banded(gx_device_printer *pde switch (cups->header.cupsColorSpace) { default : @@ -687,7 +698,7 @@ diff -up ghostscript-8.70/cups/gdevcups.c.gdevcups-y-axis ghostscript-8.70/cups/ for (x = cups->width; x > 0; x --, srcptr += 6) { *cptr-- = srcptr[1]; -@@ -4580,7 +4580,7 @@ cups_print_banded(gx_device_printer *pde +@@ -4580,7 +4586,7 @@ cups_print_banded(gx_device_printer *pde case CUPS_CSPACE_YMCK : case CUPS_CSPACE_KCMY : case CUPS_CSPACE_KCMYcm : diff --git a/ghostscript-pdftoraster-exit.patch b/ghostscript-pdftoraster-exit.patch new file mode 100644 index 0000000..89feeab --- /dev/null +++ b/ghostscript-pdftoraster-exit.patch @@ -0,0 +1,39 @@ +diff -up ghostscript-8.70/cups/pdftoraster.c.pdftoraster-exit ghostscript-8.70/cups/pdftoraster.c +--- ghostscript-8.70/cups/pdftoraster.c.pdftoraster-exit 2008-10-17 23:58:21.000000000 +0100 ++++ ghostscript-8.70/cups/pdftoraster.c 2010-01-25 10:15:42.269209639 +0000 +@@ -35,6 +35,8 @@ MIT Open Source License - http://www.o + #include + #include + #include ++#include ++#include + + #define MAX_CHECK_COMMENT_LINES 20 + #ifndef GS +@@ -123,6 +125,7 @@ int main(int argc, char *argv[], char *e + const char* apos; + int fds[2]; + int pid; ++ int status; + + parseOpts(argc, argv); + +@@ -502,8 +505,17 @@ int main(int argc, char *argv[], char *e + } + } + fclose(fp); ++ close (fds[1]); + } + +- exit(0); ++ if (waitpid (pid, &status, 0) == -1) { ++ perror (GS); ++ exit (1); ++ } ++ ++ if (WIFEXITED (status)) ++ exit(WEXITSTATUS (status)); ++ else ++ exit(1); + } + diff --git a/ghostscript.spec b/ghostscript.spec index a5a4426..7bb1730 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -5,7 +5,7 @@ Summary: A PostScript interpreter and renderer. Name: ghostscript Version: %{gs_ver} -Release: 5%{?dist} +Release: 6%{?dist} # Included CMap data is Redistributable, no modification permitted, # see http://bugzilla.redhat.com/487510 @@ -29,6 +29,7 @@ Patch10: ghostscript-cups-filters.patch Patch11: ghostscript-CVE-2009-4270.patch Patch12: ghostscript-vsnprintf.patch Patch13: ghostscript-gdevcups-y-axis.patch +Patch14: ghostscript-pdftoraster-exit.patch Requires: urw-fonts >= 1.1, ghostscript-fonts BuildRequires: xz @@ -141,6 +142,9 @@ rm -rf libpng zlib jpeg jasper # revision 10625. %patch13 -p1 -b .gdevcups-y-axis +# Fixed pdftoraster so that it waits for its sub-process to exit. +%patch14 -p1 -b .pdftoraster-exit + # Convert manual pages to UTF-8 from8859_1() { iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_" @@ -322,6 +326,11 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libgs.so %changelog +* Mon Jan 25 2010 Tim Waugh 8.70-6 +- Fixed pdftoraster so that it waits for its sub-process to exit. +- Another gdevcups duplex fix from upstream revision 10631 + (bug #541604). + * Fri Jan 22 2010 Tim Waugh 8.70-5 - Don't build static library for ijs (bug #556051).