Lines Matching defs:fd
28 #include "fd-util.h"
35 _cleanup_close_ int fd = -1;
61 fd = open(p, O_CREAT|O_RDWR|O_NOFOLLOW|O_CLOEXEC|O_NOCTTY, 0600);
62 if (fd < 0)
65 r = fcntl(fd, (operation & LOCK_NB) ? F_OFD_SETLK : F_OFD_SETLKW, &fl);
70 r = flock(fd, operation);
82 r = fstat(fd, &st);
88 fd = safe_close(fd);
92 ret->fd = fd;
95 fd = -1;
130 if (f->fd >= 0 &&
137 r = fcntl(f->fd, F_OFD_SETLK, &fl);
139 r = flock(f->fd, LOCK_EX|LOCK_NB);
151 f->fd = safe_close(f->fd);