/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 plugins.d/password-prompt.c

merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
                                   ARGP_KEY_ARG, ARGP_KEY_END,
52
52
                                   ARGP_ERR_UNKNOWN */
53
53
 
54
 
volatile bool quit_now = false;
 
54
volatile sig_atomic_t quit_now = 0;
55
55
bool debug = false;
56
56
const char *argp_program_version = "password-prompt " VERSION;
57
57
const char *argp_program_bug_address = "<mandos@fukt.bsnet.se>";
58
58
 
59
59
static void termination_handler(__attribute__((unused))int signum){
60
 
  quit_now = true;
 
60
  quit_now = 1;
61
61
}
62
62
 
63
63
int main(int argc, char **argv){
80
80
      { .name = NULL }
81
81
    };
82
82
    
83
 
    error_t parse_opt (int key, char *arg, struct argp_state *state) {
84
 
      switch (key) {
 
83
    error_t parse_opt (int key, char *arg, struct argp_state *state){
 
84
      switch (key){
85
85
      case 'p':
86
86
        prefix = arg;
87
87
        break;
242
242
    /* if(ret == 0), then the only sensible thing to do is to retry to
243
243
       read from stdin */
244
244
    fputc('\n', stderr);
245
 
    if(debug and not quit_now){
246
 
      /* If quit_now is true, we were interrupted by a signal, and
 
245
    if(debug and quit_now == 0){
 
246
      /* If quit_now is nonzero, we were interrupted by a signal, and
247
247
         will print that later, so no need to show this too. */
248
248
      fprintf(stderr, "getline() returned 0, retrying.\n");
249
249
    }