about summary refs log tree commit diff
path: root/converter/ppm/ppmtompeg/parallel.c
diff options
context:
space:
mode:
Diffstat (limited to 'converter/ppm/ppmtompeg/parallel.c')
-rw-r--r--converter/ppm/ppmtompeg/parallel.c69
1 files changed, 41 insertions, 28 deletions
diff --git a/converter/ppm/ppmtompeg/parallel.c b/converter/ppm/ppmtompeg/parallel.c
index 0fe635ed..fb0f2fe9 100644
--- a/converter/ppm/ppmtompeg/parallel.c
+++ b/converter/ppm/ppmtompeg/parallel.c
@@ -12,6 +12,7 @@
  * HEADER FILES *
  *==============*/
 
+#define _C99_SOURCE  /* Make sure snprintf() is in stdio.h */
 #define _XOPEN_SOURCE 500 /* Make sure stdio.h contains pclose() */
 /* _ALL_SOURCE is needed on AIX to make the C library include the
    socket services (e.g. define struct sockaddr)
@@ -323,6 +324,7 @@ static void
 }
 
 
+
 /*===========================================================================*
  *
  * NotifyDecodeServerReady
@@ -445,6 +447,7 @@ int id;
 }
 
 
+
 /*===========================================================================*
  *
  * SendDecodedFrame
@@ -483,6 +486,7 @@ SendDecodedFrame(MpegFrame * const frameP) {
 }
 
 
+
 /*===========================================================================*
  *
  * GetRemoteDecodedFrame
@@ -523,6 +527,7 @@ GetRemoteDecodedRefFrame(MpegFrame * const frameP,
 }
 
 
+
 /*********
   routines handling forks, execs, PIDs and signals
   save, system-style forks
@@ -558,6 +563,8 @@ static void cleanup_fork( dummy )       /* try to kill all child processes */
   }
 }
 
+
+
 /*===========================================================================*
  *
  * safe_fork
@@ -610,6 +617,7 @@ static int safe_fork(command)       /* fork child process and remember its PID *
 }
 
 
+
 /*=====================*
  * EXPORTED PROCEDURES *
  *=====================*/
@@ -637,6 +645,7 @@ SetIOConvert(boolean const separate) {
 }
 
 
+
 /*===========================================================================*
  *
  * SetParallelPerfect
@@ -656,6 +665,7 @@ SetParallelPerfect(boolean val)
 }
 
 
+
 /*===========================================================================*
  *
  * SetRemoteShell
@@ -674,6 +684,7 @@ SetRemoteShell(const char * const shell) {
 }
 
 
+
 static void
 decodedFrameToDisk(int const otherSock) {
 /*----------------------------------------------------------------------------
@@ -1145,6 +1156,7 @@ GetRemoteFrame(MpegFrame * const frameP,
 }
 
 
+
 struct combineControl {
     unsigned int numFrames;
 };
@@ -1322,6 +1334,7 @@ CombineServer(int          const numFrames,
 }
 
 
+
 /*=====================*
  * MASTER SERVER STUFF *
  *=====================*/
@@ -1341,12 +1354,12 @@ startCombineServer(const char * const encoderName,
     int          otherSock;
     const char * error;
 
-    pm_snprintf(command, sizeof(command),
-                "%s %s -max_machines %d -output_server %s %d %d %s",
-                encoderName,
-                debugMachines ? "-debug_machines" : "",
-                numMachines, masterHostName, masterPortNum,
-                numInputFiles, paramFileName);
+    snprintf(command, sizeof(command),
+             "%s %s -max_machines %d -output_server %s %d %d %s",
+             encoderName,
+             debugMachines ? "-debug_machines" : "",
+             numMachines, masterHostName, masterPortNum,
+             numInputFiles, paramFileName);
 
     machineDebug("MASTER: Starting combine server with shell command '%s'",
                  command);
@@ -1383,12 +1396,12 @@ startDecodeServer(const char * const encoderName,
     int          otherSock;
     const char * error;
 
-    pm_snprintf(command, sizeof(command),
-                "%s %s -max_machines %d -decode_server %s %d %d %s",
-                encoder_name,
-                debugMachines ? "-debug_machines" : "",
-                numMachines, masterHostName, masterPortNum,
-                numInputFiles, paramFileName);
+    snprintf(command, sizeof(command),
+             "%s %s -max_machines %d -decode_server %s %d %d %s",
+             encoder_name,
+             debugMachines ? "-debug_machines" : "",
+             numMachines, masterHostName, masterPortNum,
+             numInputFiles, paramFileName);
 
     machineDebug("MASTER: Starting decode server with shell command '%s'",
                  command);
@@ -1681,22 +1694,22 @@ startChildren(struct scheduler *   const schedulerP,
                 }
                 --childrenLeftCurrentIoServer;
             }
-            pm_snprintf(command, sizeof(command),
-                        "%s %s -l %s %s "
-                        "%s %s -child %s %d %d %d %d %d %d "
-                        "-frames %d %d %s",
-                        rsh,
-                        machineName[childNum], userName[childNum],
-                        beNice ? "nice" : "",
-                        executable[childNum],
-                        debugMachines ? "-debug_machines" : "",
-                        masterHostName, masterPortNum,
-                        remote[childNum] ? ioPortNum[numIoServers-1] : 0,
-                        combinePortNum, decodePortNum, childNum,
-                        remote[childNum] ? 1 : 0,
-                        startFrame, startFrame + nFrames - 1,
-                        remote[childNum] ?
-                          remoteParamFile[childNum] : paramFileName
+            snprintf(command, sizeof(command),
+                     "%s %s -l %s %s "
+                     "%s %s -child %s %d %d %d %d %d %d "
+                     "-frames %d %d %s",
+                     rsh,
+                     machineName[childNum], userName[childNum],
+                     beNice ? "nice" : "",
+                     executable[childNum],
+                     debugMachines ? "-debug_machines" : "",
+                     masterHostName, masterPortNum,
+                     remote[childNum] ? ioPortNum[numIoServers-1] : 0,
+                     combinePortNum, decodePortNum, childNum,
+                     remote[childNum] ? 1 : 0,
+                     startFrame, startFrame + nFrames - 1,
+                     remote[childNum] ?
+                     remoteParamFile[childNum] : paramFileName
                 );
 
             machineDebug("MASTER: Starting child server "