/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-02-05 02:42:39 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090205024239-th0d287ifnl7l3tv
* plugin-runner.c (handle_sigchld): Clarify logic.

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
  size_t buffer_size;
90
90
  size_t buffer_length;
91
91
  bool eof;
92
 
  volatile sig_atomic_t completed;
93
 
  int status;
 
92
  volatile bool completed;
 
93
  volatile int status;
94
94
  struct plugin *next;
95
95
} plugin;
96
96
 
223
223
/* Mark processes as completed when they exit, and save their exit
224
224
   status. */
225
225
static void handle_sigchld(__attribute__((unused)) int sig){
226
 
  int old_errno = errno;
227
226
  while(true){
228
227
    plugin *proc = plugin_list;
229
228
    int status;
249
248
      continue;
250
249
    }
251
250
    proc->status = status;
252
 
    proc->completed = 1;
 
251
    proc->completed = true;
253
252
  }
254
 
  errno = old_errno;
255
253
}
256
254
 
257
255
/* Prints out a password to stdout */
961
959
       from one of them */
962
960
    for(plugin *proc = plugin_list; proc != NULL;){
963
961
      /* Is this process completely done? */
964
 
      if(proc->completed and proc->eof){
 
962
      if(proc->eof and proc->completed){
965
963
        /* Only accept the plugin output if it exited cleanly */
966
964
        if(not WIFEXITED(proc->status)
967
965
           or WEXITSTATUS(proc->status) != 0){