/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: 2019-07-06 22:13:13 UTC
  • Revision ID: teddy@recompile.se-20190706221313-uaoa5cup12s72rec
mandos-ctl: Update Emacs lisp test runner code

* mandos-ctl: Update Emacs lisp after-save-hook test runner to use
              file-local-name if available (i.e. Emacs 26), or to use
              file-remote-p if not (Emacs 25).  Either should be more
              general than the tramp-* functions were.  Also use
              process-file-shell-command instead of shell-command,
              which enables the use of the less intrusive
              display-buffer-in-side-window action function argument
              to display-buffer.  This stops the takeover of buffers
              (and/or disappearance of windows) when saving.

Show diffs side-by-side

added added

removed removed

Lines of Context:
313
313
__attribute__((nonnull))
314
314
static void free_plugin(plugin *plugin_node){
315
315
  
 
316
  for(char **arg = (plugin_node->argv)+1; *arg != NULL; arg++){
 
317
    free(*arg);
 
318
  }
316
319
  free(plugin_node->name);
317
 
  for(char **arg = plugin_node->argv; *arg != NULL; arg++){
318
 
    free(*arg);
319
 
  }
320
320
  free(plugin_node->argv);
321
321
  for(char **env = plugin_node->environ; *env != NULL; env++){
322
322
    free(*env);
565
565
    case '?':                   /* --help */
566
566
      state->flags &= ~(unsigned int)ARGP_NO_EXIT; /* force exit */
567
567
      argp_state_help(state, state->out_stream, ARGP_HELP_STD_HELP);
 
568
      __builtin_unreachable();
568
569
    case -3:                    /* --usage */
569
570
      state->flags &= ~(unsigned int)ARGP_NO_EXIT; /* force exit */
570
571
      argp_state_help(state, state->out_stream,
571
572
                      ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK);
 
573
      __builtin_unreachable();
572
574
    case 'V':                   /* --version */
573
575
      fprintf(state->out_stream, "%s\n", argp_program_version);
574
576
      exit(EXIT_SUCCESS);
584
586
      if(arg[0] == '\0'){
585
587
        break;
586
588
      }
 
589
      /* FALLTHROUGH */
587
590
    default:
588
591
      return ARGP_ERR_UNKNOWN;
589
592
    }
1093
1096
    
1094
1097
    new_plugin->pid = pid;
1095
1098
    new_plugin->fd = pipefd[0];
1096
 
    
 
1099
 
 
1100
    if(debug){
 
1101
      fprintf(stderr, "Plugin %s started (PID %" PRIdMAX ")\n",
 
1102
              new_plugin->name, (intmax_t) (new_plugin->pid));
 
1103
    }
 
1104
 
1097
1105
    /* Unblock SIGCHLD so signal handler can be run if this process
1098
1106
       has already completed */
1099
1107
    ret = (int)TEMP_FAILURE_RETRY(sigprocmask(SIG_UNBLOCK,