summaryrefslogtreecommitdiff
path: root/src/libunixonacid/opendir_at.c
blob: bee971f08e5e142f5d0b2f905cab2e1230f39f77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* ISC license. */

#include <skalibs/direntry.h>
#include <skalibs/djbunix.h>
#include <skalibs/unix-transactional.h>

DIR *opendir_at (int dfd, char const *name)
{
  DIR *dir ;
  int fd = open_readatb(dfd, name) ;
  if (fd < 0) return 0 ;
  dir = fdopendir(fd) ;
  if (!dir) fd_close(fd) ;
  return dir ;
}