if ((pid = fork()) == 0)
{
// Child process comes here...
- close(0);
- dup(fds[0]);
+ dup2(fds[0], 0);
close(fds[0]);
close(fds[1]);
* Write the PPD file...
*/
- if (d->write_ppd_file(fp, catalog, locales, src, le))
+ ppdcArray *templocales = locales;
+
+ if (!templocales)
+ {
+ templocales = new ppdcArray();
+ for (ppdcCatalog *tempcatalog = (ppdcCatalog *)src->po_files->first();
+ tempcatalog;
+ tempcatalog = (ppdcCatalog *)src->po_files->next())
+ {
+ tempcatalog->locale->retain();
+ templocales->add(tempcatalog->locale);
+ }
+ }
+
+ if (d->write_ppd_file(fp, catalog, templocales, src, le))
{
cupsFileClose(fp);
return (1);
}
+ if (templocales != locales)
+ templocales->release();
+
cupsFileClose(fp);
}
}