summaryrefslogtreecommitdiff
path: root/src/libunixonacid/dd_open_read.c
blob: 1996297476b1e4dfd60b15951fe0716824e15165 (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_ref 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 ;
}