Home
last modified time | relevance | path

Searched refs:tmpfd (Results 1 – 19 of 19) sorted by relevance

/netbsd-src/external/bsd/am-utils/dist/conf/mtab/
H A Dmtab_file.c251 int tmpfd; in rewrite_mtab() local
269 tmpfd = mkstemp(tmpname); in rewrite_mtab()
270 fchmod(tmpfd, 0644); in rewrite_mtab()
273 tmpfd = open(tmpname, O_RDWR | O_CREAT | O_TRUNC, 0644); in rewrite_mtab()
275 if (tmpfd < 0) { in rewrite_mtab()
283 if (close(tmpfd) < 0) in rewrite_mtab()
H A Dmtab_mach3.c316 int tmpfd; in rewrite_mtab() local
333 tmpfd = mkstemp(tmpname); in rewrite_mtab()
334 fchmod(tmpfd, 0644); in rewrite_mtab()
337 tmpfd = open(tmpname, O_RDWR | O_CREAT | O_TRUNC, 0644); in rewrite_mtab()
339 if (tmpfd < 0) { in rewrite_mtab()
347 if (close(tmpfd) < 0) in rewrite_mtab()
H A Dmtab_linux.c346 int tmpfd; in rewrite_mtab() local
372 tmpfd = mkstemp(tmpname); in rewrite_mtab()
373 fchmod(tmpfd, 0644); in rewrite_mtab()
376 tmpfd = open(tmpname, O_RDWR | O_CREAT | O_TRUNC, 0644); in rewrite_mtab()
378 if (tmpfd < 0) { in rewrite_mtab()
386 if (close(tmpfd) < 0) in rewrite_mtab()
/netbsd-src/sys/ufs/chfs/
H A Dchfs_build.c72 struct chfs_dirent *fd, *tmpfd; in chfs_build_set_vnodecache_nlink() local
74 TAILQ_FOREACH_SAFE(fd, &vc->scan_dirents, fds, tmpfd) { in chfs_build_set_vnodecache_nlink()
115 struct chfs_dirent *fd, *tmpfd; in chfs_build_remove_unlinked_vnode() local
140 TAILQ_FOREACH_SAFE(fd, &vc->scan_dirents, fds, tmpfd) { in chfs_build_remove_unlinked_vnode()
212 struct chfs_dirent *fd, *tmpfd; in chfs_build_filesystem() local
322 TAILQ_FOREACH_SAFE(fd, &unlinked, fds, tmpfd) { in chfs_build_filesystem()
340 TAILQ_FOREACH_SAFE(fd, &vc->scan_dirents, fds, tmpfd) { in chfs_build_filesystem()
H A Dchfs_nodeops.c176 struct chfs_dirent *fd, *tmpfd; in chfs_add_fd_to_inode() local
183 TAILQ_FOREACH_SAFE(fd, &parent->dents, fds, tmpfd) { in chfs_add_fd_to_inode()
H A Dchfs_scan.c216 struct chfs_dirent *fd, *tmpfd; in chfs_add_fd_to_list() local
229 TAILQ_FOREACH_SAFE(fd, &pvc->scan_dirents, fds, tmpfd) { in chfs_add_fd_to_list()
H A Dchfs_write.c469 struct chfs_dirent *fd, *tmpfd; in chfs_do_unlink() local
481 TAILQ_FOREACH_SAFE(fd, &parent->dents, fds, tmpfd) { in chfs_do_unlink()
H A Dchfs_gc.c306 struct chfs_dirent *fd, *tmpfd; in chfs_clear_inode() local
330 TAILQ_FOREACH_SAFE(fd, &ip->dents, fds, tmpfd) { in chfs_clear_inode()
/netbsd-src/lib/libossaudio/
H A Doss4_mixer.c593 int tmpfd; in get_audio_count() local
599 if ((tmpfd = open(devname, O_RDONLY)) != -1 || in get_audio_count()
600 (tmpfd = open(devname, O_WRONLY)) != -1) { in get_audio_count()
602 close(tmpfd); in get_audio_count()
604 } while (tmpfd != -1); in get_audio_count()
614 int tmpfd; in get_mixer_count() local
620 if ((tmpfd = open(devname, O_RDONLY)) != -1) { in get_mixer_count()
622 close(tmpfd); in get_mixer_count()
624 } while (tmpfd != -1); in get_mixer_count()
/netbsd-src/usr.bin/mkdep/
H A Dmkdep.c103 int tmpfd; in run_cc() local
125 if ((tmpfd = mkstemp(tmpfilename)) < 0) in run_cc()
140 (void)dup2(tmpfd, STDOUT_FILENO); in run_cc()
141 (void)close(tmpfd); in run_cc()
160 return tmpfd; in run_cc()
/netbsd-src/usr.sbin/edquota/
H A Dedquota.c1242 int tmpfd, const char *tmppath) in editone() argument
1259 if (writeprivs(curprivs, tmpfd, name, idtype, in editone()
1266 if (readprivs(curprivs, tmpfd, dflag) < 0) in editone()
1278 int tmpfd, i; in edit() local
1280 tmpfd = mkstemp(tmppath); in edit()
1281 fchown(tmpfd, getuid(), getgid()); in edit()
1284 editone(fs, idtype, names[i], tmpfd, tmppath); in edit()
1287 close(tmpfd); in edit()
/netbsd-src/external/bsd/dhcpcd/dist/src/
H A Dscript.c260 int tmpfd; in make_env() local
263 tmpfd = mkstemp(tmpfile); in make_env()
264 if (tmpfd == -1) { in make_env()
269 fp = fdopen(tmpfd, "w+"); in make_env()
271 close(tmpfd); in make_env()
/netbsd-src/external/gpl3/binutils.old/dist/binutils/
H A Dar.c1257 int tmpfd = -1; in write_archive() local
1260 new_name = make_tempname (old_name, &tmpfd); in write_archive()
1267 obfd = bfd_fdopenw (new_name, bfd_get_target (iarch), tmpfd); in write_archive()
1271 close (tmpfd); in write_archive()
1302 tmpfd = dup (tmpfd); in write_archive()
1312 if (smart_rename (new_name, old_name, tmpfd, NULL, false) != 0) in write_archive()
H A Dobjcopy.c4831 int tmpfd = -1; in strip_main() local
4843 tmpname = make_tempname (argv[i], &tmpfd); in strip_main()
4844 if (tmpfd >= 0) in strip_main()
4845 copyfd = dup (tmpfd); in strip_main()
4859 copy_file (argv[i], tmpname, tmpfd, &statbuf, input_target, in strip_main()
5112 int tmpfd = -1; in copy_main() local
5931 tmpname = make_tempname (input_filename, &tmpfd); in copy_main()
5932 if (tmpfd >= 0) in copy_main()
5933 copyfd = dup (tmpfd); in copy_main()
5944 copy_file (input_filename, tmpname, tmpfd, &statbuf, input_target, in copy_main()
H A DChangeLog1469 * ar.c (write_archive): Rename ofd to tmpfd. Dup tmpfd before
1470 closing output temp file, and pass tmpfd to smart_rename.
/netbsd-src/external/gpl3/binutils/dist/binutils/
H A Dar.c1246 int tmpfd = -1; in write_archive() local
1249 new_name = make_tempname (old_name, &tmpfd); in write_archive()
1256 obfd = bfd_fdopenw (new_name, bfd_get_target (iarch), tmpfd); in write_archive()
1260 close (tmpfd); in write_archive()
1289 tmpfd = dup (tmpfd); in write_archive()
1298 if (smart_rename (new_name, old_name, tmpfd, NULL, false) != 0) in write_archive()
H A Dobjcopy.c4943 int tmpfd = -1; in strip_main() local
4955 tmpname = make_tempname (argv[i], &tmpfd); in strip_main()
4956 if (tmpfd >= 0) in strip_main()
4957 copyfd = dup (tmpfd); in strip_main()
4971 copy_file (argv[i], tmpname, tmpfd, &statbuf, input_target, in strip_main()
5229 int tmpfd = -1; in copy_main() local
6059 tmpname = make_tempname (input_filename, &tmpfd); in copy_main()
6060 if (tmpfd >= 0) in copy_main()
6061 copyfd = dup (tmpfd); in copy_main()
6072 copy_file (input_filename, tmpname, tmpfd, &statbuf, input_target, in copy_main()
H A DChangeLog1974 * ar.c (write_archive): Rename ofd to tmpfd. Dup tmpfd before
1975 closing output temp file, and pass tmpfd to smart_rename.
/netbsd-src/external/bsd/openldap/dist/clients/tools/
H A Dldapsearch.c1994 int tmpfd; in print_entry() local
2001 tmpfd = mkstemp( tmpfname ); in print_entry()
2003 if ( tmpfd < 0 ) { in print_entry()
2008 if (( tmpfp = fdopen( tmpfd, "w")) == NULL ) { in print_entry()