/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-06-08 00:44:52 UTC
  • Revision ID: teddy@recompile.se-20140608004452-6p928psyr1gbcawn
Make mandos-client use more scandirat().

* plugins.d/mandos-client.d (main): Use scandirat() when removing
                                    GPGME temp directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2622
2622
    if(tempdir_fd == -1){
2623
2623
      perror_plus("open");
2624
2624
    } else {
2625
 
      int numentries = scandir(tempdir, &direntries, notdotentries,
2626
 
                               alphasort);
 
2625
#ifdef __GLIBC__
 
2626
#if __GLIBC_PREREQ(2, 15)
 
2627
      int numentries = scandirat(tempdir_fd, ".", &direntries,
 
2628
                                 notdotentries, alphasort);
 
2629
#else  /* not __GLIBC_PREREQ(2, 15) */
 
2630
      int numentries = scandir(tempdir, &direntries, notdotentries,
 
2631
                               alphasort);
 
2632
#endif  /* not __GLIBC_PREREQ(2, 15) */
 
2633
#else   /* not __GLIBC__ */
 
2634
      int numentries = scandir(tempdir, &direntries, notdotentries,
 
2635
                               alphasort);
 
2636
#endif  /* not __GLIBC__ */
2627
2637
      if(numentries > 0){
2628
2638
        for(int i = 0; i < numentries; i++){
2629
2639
          ret = unlinkat(tempdir_fd, direntries[i]->d_name, 0);