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

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

int dd_open_read (dirdescriptor_t *dd, char const *path)
{
  dirdescriptor_t d = DIRDESCRIPTOR_ZERO ;
  d.fd = open_read(path) ;
  if (d.fd < 0) return 0 ;
  d.lnkfn = path ;
  *dd = d ;
  return 1 ;
}