/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/mandos-client.c

  • Committer: Teddy Hogeborn
  • Date: 2014-12-21 12:54:46 UTC
  • Revision ID: teddy@recompile.se-20141221125446-bgdpi7ad9mk0o1q6
mandos (Client.config_parser): Move comment to correct place.

A comment was left behind when the code was rewritten; move the
comment to the appropriate place.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1076
1076
     timed out */
1077
1077
  
1078
1078
  if(quit_now){
 
1079
    avahi_s_service_resolver_free(r);
1079
1080
    return;
1080
1081
  }
1081
1082
  
1649
1650
        _exit(EXIT_FAILURE);
1650
1651
      }
1651
1652
    } else {
 
1653
      if(hook_pid == -1){
 
1654
        perror_plus("fork");
 
1655
        free(direntry);
 
1656
        continue;
 
1657
      }
1652
1658
      int status;
1653
1659
      if(TEMP_FAILURE_RETRY(waitpid(hook_pid, &status, 0)) == -1){
1654
1660
        perror_plus("waitpid");
 
1661
        free(direntry);
1655
1662
        continue;
1656
1663
      }
1657
1664
      if(WIFEXITED(status)){
1659
1666
          fprintf_plus(stderr, "Warning: network hook \"%s\" exited"
1660
1667
                       " with status %d\n", direntry->d_name,
1661
1668
                       WEXITSTATUS(status));
 
1669
          free(direntry);
1662
1670
          continue;
1663
1671
        }
1664
1672
      } else if(WIFSIGNALED(status)){
1665
1673
        fprintf_plus(stderr, "Warning: network hook \"%s\" died by"
1666
1674
                     " signal %d\n", direntry->d_name,
1667
1675
                     WTERMSIG(status));
 
1676
        free(direntry);
1668
1677
        continue;
1669
1678
      } else {
1670
1679
        fprintf_plus(stderr, "Warning: network hook \"%s\""
1671
1680
                     " crashed\n", direntry->d_name);
 
1681
        free(direntry);
1672
1682
        continue;
1673
1683
      }
1674
1684
    }
1676
1686
      fprintf_plus(stderr, "Network hook \"%s\" ran successfully\n",
1677
1687
                   direntry->d_name);
1678
1688
    }
 
1689
    free(direntry);
1679
1690
  }
1680
1691
  free(direntries);
1681
1692
  if((int)TEMP_FAILURE_RETRY(close(hookdir_fd)) == -1){
2275
2286
        if(ret_errno != 0){
2276
2287
          errno = ret_errno;
2277
2288
          perror_plus("argz_add");
 
2289
          free(direntries[i]);
2278
2290
          continue;
2279
2291
        }
2280
2292
        if(debug){
2281
2293
          fprintf_plus(stderr, "Will use interface \"%s\"\n",
2282
2294
                       direntries[i]->d_name);
2283
2295
        }
 
2296
        free(direntries[i]);
2284
2297
      }
2285
2298
      free(direntries);
2286
2299
    } else {
2638
2651
                         " \"%s\", 0): %s\n", tempdir,
2639
2652
                         direntries[i]->d_name, strerror(errno));
2640
2653
          }
 
2654
          free(direntries[i]);
2641
2655
        }
2642
2656
        
2643
2657
        /* need to clean even if 0 because man page doesn't specify */