Lines Matching +full:no +full:- +full:can +full:- +full:fd
1 /*-
2 * Copyright (c) 2007 Dag-Erling Smørgrav
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
40 int fd, operation, serrno, trunc; in flopen() local
65 if ((fd = open(path, flags, mode)) == -1) in flopen()
66 /* non-existent or no access */ in flopen()
67 return (-1); in flopen()
68 if (flock(fd, operation) == -1) { in flopen()
71 (void)close(fd); in flopen()
73 return (-1); in flopen()
75 if (stat(path, &sb) == -1) { in flopen()
77 (void)close(fd); in flopen()
80 if (fstat(fd, &fsb) == -1) { in flopen()
81 /* can't happen [tm] */ in flopen()
83 (void)close(fd); in flopen()
85 return (-1); in flopen()
90 (void)close(fd); in flopen()
93 if (trunc && ftruncate(fd, 0) != 0) { in flopen()
94 /* can't happen [tm] */ in flopen()
96 (void)close(fd); in flopen()
98 return (-1); in flopen()
100 return (fd); in flopen()