/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/plymouth.c

  • Committer: Teddy Hogeborn
  • Date: 2014-03-10 06:34:36 UTC
  • Revision ID: teddy@recompile.se-20140310063436-zksdghqvv6k1pbyg
Do not add a new server to server list if clock_gettime() fails

* plugins.d/mandos-client.c (add_server): Set server.last_seen before
                                          adding new server, in case
                                          clock_gettime() fails.

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
  
85
85
  va_start(ap, formatstring);
86
86
  ret = vasprintf(&text, formatstring, ap);
87
 
  if(ret == -1){
 
87
  if (ret == -1){
88
88
    fprintf(stderr, "Mandos plugin %s: ",
89
89
            program_invocation_short_name);
90
90
    vfprintf(stderr, formatstring, ap);
179
179
    int i = 0;
180
180
    for (; argv[i]!=NULL; i++){
181
181
      tmp = realloc(new_argv, sizeof(const char *) * ((size_t)i + 1));
182
 
      if(tmp == NULL){
 
182
      if (tmp == NULL){
183
183
        error_plus(0, errno, "realloc");
184
184
        free(new_argv);
185
185
        _exit(EX_OSERR);
290
290
  if(proc_id == 0){
291
291
    struct dirent **direntries = NULL;
292
292
    ret = scandir("/proc", &direntries, is_plymouth, alphasort);
293
 
    if(ret == -1){
 
293
    if (ret == -1){
294
294
      error_plus(0, errno, "scandir");
295
295
    }
296
 
    if(ret > 0){
 
296
    if (ret > 0){
297
297
      ret = sscanf(direntries[0]->d_name, "%" SCNuMAX, &proc_id);
298
 
      if(ret < 0){
 
298
      if (ret < 0){
299
299
        error_plus(0, errno, "sscanf");
300
300
      }
301
301
    }