summaryrefslogtreecommitdiff
path: root/gs
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2011-06-04 22:09:58 +0100
committerRobin Watts <Robin.Watts@artifex.com>2011-06-05 00:06:12 +0100
commit4aff3e0d813cb00eb62db9720cf99b2d419f999a (patch)
tree1fedadcc05bcdf096102e3251964e37cbc15f35e /gs
parent77b456f298aeabaa4b27b63a9ead0aa0470ac5b8 (diff)
Move various uses of fopen to use gp_fopen.
For portability we should be using gp_fopen, not fopen.
Diffstat (limited to 'gs')
-rw-r--r--gs/base/gdevdevn.c6
-rw-r--r--gs/base/gdevimdi.c2
-rw-r--r--gs/base/gdevrinkj.c2
-rw-r--r--gs/base/gdevtxtw.c2
-rw-r--r--gs/base/gdevwts.c6
-rw-r--r--gs/psi/imainarg.c2
6 files changed, 10 insertions, 10 deletions
diff --git a/gs/base/gdevdevn.c b/gs/base/gdevdevn.c
index fa857f98b..30bc46caf 100644
--- a/gs/base/gdevdevn.c
+++ b/gs/base/gdevdevn.c
@@ -2039,7 +2039,7 @@ spotcmyk_print_page(gx_device_printer * pdev, FILE * prn_stream)
/* Open the output files for the spot colors */
for(i = 0; i < nspot; i++) {
sprintf(spotname, "%ss%d", pdevn->fname, i);
- spot_file[i] = fopen(spotname, "wb");
+ spot_file[i] = gp_fopen(spotname, "wb");
if (spot_file[i] == NULL) {
code = gs_error_VMerror;
goto prn_done;
@@ -2408,11 +2408,11 @@ devn_write_pcx_file(gx_device_printer * pdev, char * filename, int ncomp,
FILE * out;
int depth = bpc_to_depth(ncomp, bpc);
- in = fopen(filename, "rb");
+ in = gp_fopen(filename, "rb");
if (!in)
return_error(gs_error_invalidfileaccess);
sprintf(outname, "%s.pcx", filename);
- out = fopen(outname, "wb");
+ out = gp_fopen(outname, "wb");
if (!out) {
fclose(in);
return_error(gs_error_invalidfileaccess);
diff --git a/gs/base/gdevimdi.c b/gs/base/gdevimdi.c
index 97587706f..e8f9bcb23 100644
--- a/gs/base/gdevimdi.c
+++ b/gs/base/gdevimdi.c
@@ -196,7 +196,7 @@ imdi_print_page(gx_device_printer *pdev, FILE *prn_stream)
dprintf1("output file: %s\n", name);
- fp[k] = fopen(name, "wb");
+ fp[k] = gp_fopen(name, "wb");
if (!fp[k])
{
code = gs_throw2(-1, "could not open file: %s (%s)", name, strerror(errno));
diff --git a/gs/base/gdevrinkj.c b/gs/base/gdevrinkj.c
index 2700fed29..cc6e41c3a 100644
--- a/gs/base/gdevrinkj.c
+++ b/gs/base/gdevrinkj.c
@@ -927,7 +927,7 @@ rinkj_set_luts(rinkj_device *rdev,
RinkjDevice *printer_dev, RinkjDevice *cmyk_dev,
const char *config_fn, const RinkjDeviceParams *params)
{
- FILE *f = fopen(config_fn, "r");
+ FILE *f = gp_fopen(config_fn, "r");
char linebuf[256];
char key[256];
char *val;
diff --git a/gs/base/gdevtxtw.c b/gs/base/gdevtxtw.c
index e334c3f03..32e3d69ac 100644
--- a/gs/base/gdevtxtw.c
+++ b/gs/base/gdevtxtw.c
@@ -280,7 +280,7 @@ txtwrite_put_params(gx_device * dev, gs_param_list * plist)
}
memcpy(tdev->fname, ofs.data, ofs.size);
tdev->fname[ofs.size] = 0;
- tdev->file = fopen(tdev->fname, "wb");
+ tdev->file = gp_fopen(tdev->fname, "wb");
if (tdev->file == 0)
return_error(gs_error_ioerror);
}
diff --git a/gs/base/gdevwts.c b/gs/base/gdevwts.c
index e048bfd22..66f3c2868 100644
--- a/gs/base/gdevwts.c
+++ b/gs/base/gdevwts.c
@@ -290,7 +290,7 @@ wts_halftone_line_8(wts_cooked_halftone *wch, int y, int width, int n_planes,
static int
wts_load_halftone(gs_memory_t *mem, wts_cooked_halftone *wch, const char *fn)
{
- FILE *f = fopen(fn, "rb");
+ FILE *f = gp_fopen(fn, "rb");
int size;
byte *buf;
wts_screen_t *wts;
@@ -353,7 +353,7 @@ wts_init_halftones(gx_device_wts *wdev, int n_planes)
sprintf(wts_fn, "wts_plane_%d", i);
{
FILE *f;
- if ((f=fopen(wts_fn,"r"))) {
+ if ((f=gp_fopen(wts_fn,"r"))) {
fclose(f);
} else {
sprintf(wts_fn, "/usr/local/lib/ghostscript/wts_plane_%d", i);
@@ -414,7 +414,7 @@ wtscmyk_print_page(gx_device_printer *pdev, FILE *prn_stream)
if (!strcmp(fn + fname_len - 5, "c.pbm"))
fn[fname_len - 5] = plane_name[i];
}
- ostream[i] = fopen(fn, "wb");
+ ostream[i] = gp_fopen(fn, "wb");
}
fprintf(ostream[i], "P4\n%d %d\n", pdev->width, pdev->height);
}
diff --git a/gs/psi/imainarg.c b/gs/psi/imainarg.c
index 560988b1e..19938e857 100644
--- a/gs/psi/imainarg.c
+++ b/gs/psi/imainarg.c
@@ -879,7 +879,7 @@ try_stdout_redirect(gs_main_instance * minst,
minst->heap->gs_lib_ctx->stdout_to_stderr = 1;
}
else if ((minst->heap->gs_lib_ctx->fstdout2 =
- fopen(filename, "w")) == (FILE *)NULL)
+ gp_fopen(filename, "w")) == (FILE *)NULL)
return_error(e_invalidfileaccess);
minst->heap->gs_lib_ctx->stdout_is_redirected = 1;
}