diff options
-rw-r--r-- | converter/other/pnmtops.c | 2 | ||||
-rw-r--r-- | converter/other/pstopnm.c | 2 | ||||
-rw-r--r-- | converter/other/tifftopnm.c | 2 | ||||
-rw-r--r-- | lib/libsystem.c | 4 | ||||
-rw-r--r-- | pm_config.in.h | 5 | ||||
-rw-r--r-- | urt/rle_open_f.c | 2 |
6 files changed, 11 insertions, 6 deletions
diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c index a2256523..4b56b6a2 100644 --- a/converter/other/pnmtops.c +++ b/converter/other/pnmtops.c @@ -772,7 +772,7 @@ static void makePipe(int * const pipeFdArray) { int rc; - rc = pipe(pipeFdArray); + rc = pm_pipe(pipeFdArray); if (rc == -1) pm_error("pipe() failed, errno = %d (%s)", errno, strerror(errno)); } diff --git a/converter/other/pstopnm.c b/converter/other/pstopnm.c index 9af1f83d..1dd27140 100644 --- a/converter/other/pstopnm.c +++ b/converter/other/pstopnm.c @@ -782,7 +782,7 @@ executeGhostscript(char const pstrans[], if (strlen(outfile_arg) > 80) pm_error("output file spec too long."); - rc = pipe(pipefd); + rc = pm_pipe(pipefd); if (rc < 0) pm_error("Unable to create pipe to talk to Ghostscript process. " "errno = %d (%s)", errno, strerror(errno)); diff --git a/converter/other/tifftopnm.c b/converter/other/tifftopnm.c index 67e7c52f..679dff71 100644 --- a/converter/other/tifftopnm.c +++ b/converter/other/tifftopnm.c @@ -727,7 +727,7 @@ spawnWithInputPipe(const char * const shellCmd, int fd[2]; int rc; - rc = pipe(fd); + rc = pm_pipe(fd); if (rc != 0) pm_asprintf(errorP, "Failed to create pipe for process input. " diff --git a/lib/libsystem.c b/lib/libsystem.c index 1f445844..259f18e4 100644 --- a/lib/libsystem.c +++ b/lib/libsystem.c @@ -133,7 +133,7 @@ createPipeFeeder(void pipeFeederRtn(int, void *), int pipeToFeed[2]; pid_t rc; - pipe(pipeToFeed); + pm_pipe(pipeToFeed); rc = fork(); if (rc < 0) { pm_error("fork() of stdin feeder failed. errno=%d (%s)", @@ -179,7 +179,7 @@ spawnProcessor(const char * const progName, pid_t rc; if (pipeStdout) - pipe(stdoutpipe); + pm_pipe(stdoutpipe); rc = fork(); if (rc < 0) { diff --git a/pm_config.in.h b/pm_config.in.h index 2cea5a86..684d60a1 100644 --- a/pm_config.in.h +++ b/pm_config.in.h @@ -337,3 +337,8 @@ typedef int qsort_comparison_fn(const void *, const void *); #define pm_mkdir(dir, perm) mkdir(dir, perm) #endif +#if MSVCRT + #define pm_pipe _pipe +#else + #define pm_pipe pipe +#endif diff --git a/urt/rle_open_f.c b/urt/rle_open_f.c index 956d5d01..f653e6a0 100644 --- a/urt/rle_open_f.c +++ b/urt/rle_open_f.c @@ -52,7 +52,7 @@ my_popen(const char * const cmd, return NULL; } - if ( pipe(pipefd) < 0 ) + if (pm_pipe(pipefd) < 0 ) return NULL; /* Flush known files. */ |