Lines Matching +full:no +full:- +full:can +full:- +full:fd
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2007-2009 Dag-Erling Smørgrav
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * code's apparent simplicity; there would be no need for this function if it
51 int fd, operation, serrno, trunc; in vflopenat() local
72 if ((fd = openat(dirfd, path, flags, mode)) == -1) in vflopenat()
73 /* non-existent or no access */ in vflopenat()
74 return (-1); in vflopenat()
75 if (flock(fd, operation) == -1) { in vflopenat()
78 (void)close(fd); in vflopenat()
80 return (-1); in vflopenat()
82 if (fstatat(dirfd, path, &sb, 0) == -1) { in vflopenat()
84 (void)close(fd); in vflopenat()
87 if (fstat(fd, &fsb) == -1) { in vflopenat()
88 /* can't happen [tm] */ in vflopenat()
90 (void)close(fd); in vflopenat()
92 return (-1); in vflopenat()
97 (void)close(fd); in vflopenat()
100 if (trunc && ftruncate(fd, 0) != 0) { in vflopenat()
101 /* can't happen [tm] */ in vflopenat()
103 (void)close(fd); in vflopenat()
105 return (-1); in vflopenat()
112 if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) { in vflopenat()
114 (void)close(fd); in vflopenat()
116 return (-1); in vflopenat()
119 return (fd); in vflopenat()