Lines Matching refs:fd
691 int fd;
746 fd = dfopen(fn, omode, cmode, sff);
747 if (fd < 0)
748 return fd;
749 if (filechanged(fn, fd, &stb))
752 (void) close(fd);
759 ftruncate(fd, (off_t) 0) < 0)
766 (void) close(fd);
772 return fd;
794 int fd;
825 fd = safeopen(fn, omode, cmode, sff);
826 if (fd < 0)
836 (void *) &fd, fmode, NULL);
846 (void) close(fd);
855 ** fd -- file descriptor to check.
864 filechanged(fn, fd, stb)
866 int fd;
881 if (fstat(fd, &sta) < 0)
934 int fd = -1;
941 fd = open(filename, omode, cmode);
942 if (fd >= 0)
956 fd >= 0 &&
957 fstat(fd, &st) >= 0 &&
970 if (!lockfile(fd, filename, NULL, locktype))
974 (void) close(fd);
975 fd = -1;
981 return fd;