about summary refs log tree commit diff
path: root/editor/pnmsmooth.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-03-27 01:38:28 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-03-27 01:38:28 +0000
commit367c9cb514c9da766488b9bdb218a18e31cb7624 (patch)
treef9e343be94161a4837f0f1c1d072a35538ae0f63 /editor/pnmsmooth.c
parent6e88e3326cb0c7f7975b56189278cab3f84ba1bd (diff)
downloadnetpbm-mirror-367c9cb514c9da766488b9bdb218a18e31cb7624.tar.gz
netpbm-mirror-367c9cb514c9da766488b9bdb218a18e31cb7624.tar.xz
netpbm-mirror-367c9cb514c9da766488b9bdb218a18e31cb7624.zip
Promote Stable (10.47) to Super Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@2691 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor/pnmsmooth.c')
-rw-r--r--editor/pnmsmooth.c39
1 files changed, 4 insertions, 35 deletions
diff --git a/editor/pnmsmooth.c b/editor/pnmsmooth.c
index a18511c7..16d8ec33 100644
--- a/editor/pnmsmooth.c
+++ b/editor/pnmsmooth.c
@@ -23,12 +23,12 @@
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
-#include <sys/wait.h>
 
 #include "pm_c_util.h"
 #include "mallocvar.h"
 #include "shhopt.h"
 #include "nstring.h"
+#include "pm_system.h"
 #include "pnm.h"
 
 
@@ -36,7 +36,7 @@ struct cmdlineInfo {
     /* All the information the user supplied in the command line,
        in a form easy for the program to use.
     */
-    const char *inputFilespec;  /* Filespec of input file */
+    const char * inputFilespec;  /* Filespec of input file */
     unsigned int width;
     unsigned int height;
     const char * dump;
@@ -176,38 +176,6 @@ writeConvolutionImage(FILE *       const cofp,
 
 
 
-static void
-runPnmconvol(const char * const inputFilespec,
-             const char * const convolutionImageFilespec) {
-
-    /* fork a Pnmconvol process */
-    pid_t rc;
-
-    rc = fork();
-    if (rc < 0)
-        pm_error("fork() failed.  errno=%d (%s)", errno, strerror(errno));
-    else if (rc == 0) {
-        /* child process executes following code */
-
-        execlp("pnmconvol",
-               "pnmconvol", convolutionImageFilespec, inputFilespec,
-               NULL);
-
-        pm_error("error executing pnmconvol command.  errno=%d (%s)",
-                 errno, strerror(errno));
-    } else {
-        /* This is the parent */
-        pid_t const childPid = rc;
-
-        int status;
-
-        /* wait for child to finish */
-        while (wait(&status) != childPid);
-    }
-}
-
-
-
 int
 main(int argc, char ** argv) {
 
@@ -232,7 +200,8 @@ main(int argc, char ** argv) {
     if (cmdline.dump) {
         /* We're done.  Convolution image is in user's file */
     } else {
-        runPnmconvol(cmdline.inputFilespec, tempfileName);
+        pm_system_lp("pnmconvol", NULL, NULL, NULL, NULL,
+                     "pnmconvol", tempfileName, cmdline.inputFilespec, NULL);
 
         unlink(tempfileName);
         strfree(tempfileName);