open_truncatb.c (294B)
1 /* ISC license. */ 2 3 #include <skalibs/djbunix.h> 4 #include <skalibs/unix-transactional.h> 5 6 int open_truncatb (int dirfd, char const *name) 7 { 8 int fd = open_truncat(dirfd, name) ; 9 if (fd == -1) return -1 ; 10 if (ndelay_off(fd) == -1) 11 { 12 fd_close(fd) ; 13 return -1 ; 14 } 15 return fd ; 16 }