skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

dir_close.c (219B)


      1 /* ISC license. */
      2 
      3 #include <errno.h>
      4 #include <skalibs/direntry.h>
      5 
      6 void dir_close (DIR *dir)
      7 {
      8   int e = errno ;
      9   for (;;)
     10   {
     11     if (closedir(dir) == 0) break ;
     12     if (errno != EINTR) break ;
     13   }
     14   errno = e ;
     15 }