/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugin-runner.c

  • Committer: Teddy Hogeborn
  • Date: 2009-01-15 05:27:55 UTC
  • mfrom: (237.2.9 mandos-release)
  • Revision ID: teddy@fukt.bsnet.se-20090115052755-luw0gjx8727p24o3
Merge from release branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
  if(name != NULL){
116
116
    copy_name = strdup(name);
117
117
    if(copy_name == NULL){
118
 
      free(new_plugin);
119
118
      return NULL;
120
119
    }
121
120
  }
122
121
  
123
 
  *new_plugin = (plugin){ .name = copy_name,
124
 
                          .argc = 1,
125
 
                          .disabled = false,
126
 
                          .next = plugin_list };
 
122
  *new_plugin = (plugin) { .name = copy_name,
 
123
                           .argc = 1,
 
124
                           .disabled = false,
 
125
                           .next = plugin_list };
127
126
  
128
127
  new_plugin->argv = malloc(sizeof(char *) * 2);
129
128
  if(new_plugin->argv == NULL){
232
231
      break;
233
232
    }
234
233
    if(pid == -1){
235
 
      if(errno == ECHILD){
236
 
        /* No child processes */
237
 
        break;
 
234
      if(errno != ECHILD){
 
235
        perror("waitpid");
238
236
      }
239
 
      perror("waitpid");
 
237
      /* No child processes */
 
238
      break;
240
239
    }
241
240
    
242
241
    /* A child exited, find it in process_list */
376
375
  };
377
376
  
378
377
  error_t parse_opt(int key, char *arg, __attribute__((unused))
379
 
                    struct argp_state *state){
380
 
    switch(key){
 
378
                    struct argp_state *state) {
 
379
    switch(key) {
381
380
    case 'g':                   /* --global-options */
382
381
      if(arg != NULL){
383
382
        char *p;
512
511
     ignores everything but the --config-file option. */
513
512
  error_t parse_opt_config_file(int key, char *arg,
514
513
                                __attribute__((unused))
515
 
                                struct argp_state *state){
516
 
    switch(key){
 
514
                                struct argp_state *state) {
 
515
    switch(key) {
517
516
    case 'g':                   /* --global-options */
518
517
    case 'G':                   /* --global-env */
519
518
    case 'o':                   /* --options-for */
970
969
              fprintf(stderr, "Plugin %" PRIdMAX " exited with status"
971
970
                      " %d\n", (intmax_t) (proc->pid),
972
971
                      WEXITSTATUS(proc->status));
973
 
            } else if(WIFSIGNALED(proc->status)){
 
972
            } else if(WIFSIGNALED(proc->status)) {
974
973
              fprintf(stderr, "Plugin %" PRIdMAX " killed by signal"
975
974
                      " %d\n", (intmax_t) (proc->pid),
976
975
                      WTERMSIG(proc->status));