components/foomatic/filters/patches/pid_t.patch
changeset 760 c73130bfdec1
equal deleted inserted replaced
759:5bd27f9a56b8 760:c73130bfdec1
       
     1 This patch fixes the build when SPRO C compiler is used. The original source
       
     2 code inconsistently mix "int" and "pid_t" data types.
       
     3 
       
     4 compile error seen:
       
     5 
       
     6 "process.c", line 185: identifier redeclared: start_system_process
       
     7 "process.c", line 190: identifier redeclared: start_process
       
     8 cc: acomp failed for process.c
       
     9 make[2]: *** [foomatic_rip-process.o] Error 1
       
    10 make[1]: *** [all] Error 2
       
    11 
       
    12 --- a/foomaticrip.c	2012-03-14 20:45:28.000000000 +0100
       
    13 +++ b/foomaticrip.c	2012-03-19 10:45:27.569249000 +0100
       
    14 @@ -981,7 +981,8 @@
       
    15      int startpos;
       
    16      size_t n;
       
    17      FILE *fchandle = NULL;
       
    18 -    int fcpid = 0, ret;
       
    19 +    pid_t fcpid = 0;
       
    20 +    int ret;
       
    21  
       
    22      if (!strcasecmp(filename, "<STDIN>"))
       
    23          file = stdin;
       
    24 --- a/process.c	2012-03-14 20:45:28.000000000 +0100
       
    25 +++ b/process.c	2012-03-19 10:36:39.639793000 +0100
       
    26 @@ -45,7 +45,7 @@
       
    27      { "", -1, 0 }
       
    28  };
       
    29  
       
    30 -void add_process(const char *name, int pid, int isgroup)
       
    31 +void add_process(const char *name, pid_t pid, int isgroup)
       
    32  {
       
    33      int i;
       
    34      for (i = 0; i < MAX_CHILDS; i++) {
       
    35 @@ -59,7 +59,7 @@
       
    36      rip_die(EXIT_PRNERR_NORETRY_BAD_SETTINGS, "Didn't think there would be that many child processes... Exiting.\n");
       
    37  }
       
    38  
       
    39 -int find_process(int pid)
       
    40 +int find_process(pid_t pid)
       
    41  {
       
    42      int i;
       
    43      for (i = 0; i < MAX_CHILDS; i++)
       
    44 @@ -90,7 +90,7 @@
       
    45      clear_proc_list();
       
    46  }
       
    47  
       
    48 -static int _start_process(const char *name,
       
    49 +static pid_t _start_process(const char *name,
       
    50                            int (*proc_func)(FILE *, FILE *, void *),
       
    51                            void *user_arg, FILE **pipe_in, FILE **pipe_out,
       
    52                            int createprocessgroup)
       
    53 @@ -182,17 +182,17 @@
       
    54      return EXIT_PRNERR_NORETRY_BAD_SETTINGS;
       
    55  }
       
    56  
       
    57 -int start_system_process(const char *name, const char *command, FILE **fdin, FILE **fdout)
       
    58 +pid_t start_system_process(const char *name, const char *command, FILE **fdin, FILE **fdout)
       
    59  {
       
    60      return _start_process(name, exec_command, (void*)command, fdin, fdout, 1);
       
    61  }
       
    62  
       
    63 -int start_process(const char *name, int (*proc_func)(FILE *, FILE *, void *), void *user_arg, FILE **fdin, FILE **fdout)
       
    64 +pid_t start_process(const char *name, int (*proc_func)(FILE *, FILE *, void *), void *user_arg, FILE **fdin, FILE **fdout)
       
    65  {
       
    66      return _start_process(name, proc_func, user_arg, fdin, fdout, 0);
       
    67  }
       
    68  
       
    69 -int wait_for_process(int pid)
       
    70 +int wait_for_process(pid_t pid)
       
    71  {
       
    72      int i;
       
    73      int status;
       
    74 @@ -216,7 +216,7 @@
       
    75  
       
    76  int run_system_process(const char *name, const char *command)
       
    77  {
       
    78 -    int pid = start_system_process(name, command, NULL, NULL);
       
    79 +    pid_t pid = start_system_process(name, command, NULL, NULL);
       
    80      return wait_for_process(pid);
       
    81  }
       
    82  
       
    83 --- a/process.h	2012-03-14 20:45:28.000000000 +0100
       
    84 +++ b/process.h	2012-03-19 10:37:07.577847000 +0100
       
    85 @@ -40,7 +40,7 @@
       
    86                            const char *alreadyread,
       
    87                            size_t alreadyread_len);
       
    88  
       
    89 -int wait_for_process(int pid);
       
    90 +int wait_for_process(pid_t pid);
       
    91  
       
    92  void kill_all_processes();
       
    93