/mandos/release

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

« back to all changes in this revision

Viewing changes to plugins.d/splashy.c

* plugin-runner.c (getplugin, add_environment, main): Handle EINTR
                                                      properly.

* plugins.d/mandos-client.c (start_mandos_communication): Bug fix:
  move out "decrypted_buffer_size" to where it is needed.

* plugins.d/splashy.c (termination_handler): Save signal received.
  (main): Check return value from "sigaddset()".

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
                                   WEXITSTATUS() */
49
49
 
50
50
sig_atomic_t interrupted_by_signal = 0;
 
51
int signal_received;
51
52
 
52
 
static void termination_handler(__attribute__((unused))int signum){
 
53
static void termination_handler(int signum){
 
54
  if(interrupted_by_signal){
 
55
    return;
 
56
  }
53
57
  interrupted_by_signal = 1;
 
58
  signal_received = signum;
54
59
}
55
60
 
56
61
int main(__attribute__((unused))int argc,
170
175
                     .sa_flags = 0 };
171
176
    sigemptyset(&new_action.sa_mask);
172
177
    sigaddset(&new_action.sa_mask, SIGINT);
 
178
    if(ret == -1){
 
179
      perror("sigaddset");
 
180
      free(prompt);
 
181
      return EXIT_FAILURE;
 
182
    }
173
183
    sigaddset(&new_action.sa_mask, SIGHUP);
 
184
    if(ret == -1){
 
185
      perror("sigaddset");
 
186
      free(prompt);
 
187
      return EXIT_FAILURE;
 
188
    }
174
189
    sigaddset(&new_action.sa_mask, SIGTERM);
 
190
    if(ret == -1){
 
191
      perror("sigaddset");
 
192
      free(prompt);
 
193
      return EXIT_FAILURE;
 
194
    }
175
195
    ret = sigaction(SIGINT, NULL, &old_action);
176
196
    if(ret == -1){
177
197
      perror("sigaction");