| /freebsd/usr.bin/mail/ |
| H A D | edit.c | 135 char *edit, tempname[PATHSIZE]; in run_editor() local 138 (void)snprintf(tempname, sizeof(tempname), in run_editor() 140 if ((t = mkstemp(tempname)) == -1 || in run_editor() 142 warn("%s", tempname); in run_editor() 146 warn("%s", tempname); in run_editor() 147 (void)rm(tempname); in run_editor() 163 warnx("%s", tempname); in run_editor() 164 (void)rm(tempname); in run_editor() 169 warn("%s", tempname); in run_editor() 170 (void)rm(tempname); in run_editor() [all …]
|
| H A D | quit.c | 70 char *mbox, tempname[PATHSIZE]; in quit() local 104 (void)snprintf(tempname, sizeof(tempname), in quit() 106 if ((fd = mkstemp(tempname)) == -1 || in quit() 123 if ((rbuf = Fopen(tempname, "r")) == NULL) in quit() 125 (void)rm(tempname); in quit() 196 (void)snprintf(tempname, sizeof(tempname), in quit() 198 if ((fd = mkstemp(tempname)) == -1 || in quit() 200 warn("%s", tempname); in quit() 204 if ((ibuf = Fopen(tempname, "r")) == NULL) { in quit() 205 warn("%s", tempname); in quit() [all …]
|
| H A D | collect.c | 71 char linebuf[LINESIZE], tempname[PATHSIZE], *cp, getsub; in collect() local 97 (void)rm(tempname); in collect() 103 (void)snprintf(tempname, sizeof(tempname), in collect() 105 if ((fd = mkstemp(tempname)) == -1 || in collect() 107 warn("%s", tempname); in collect() 110 (void)rm(tempname); in collect() 427 if (forward(linebuf + 2, collf, tempname, c) < 0) in collect() 566 char *sh, tempname[PATHSIZE]; in mespipe() local 568 (void)snprintf(tempname, sizeof(tempname), in mespipe() 570 if ((fd = mkstemp(tempname)) == -1 || in mespipe() [all …]
|
| H A D | send.c | 454 char tempname[PATHSIZE]; in infix() local 456 (void)snprintf(tempname, sizeof(tempname), in infix() 458 if ((fd = mkstemp(tempname)) == -1 || in infix() 460 warn("%s", tempname); in infix() 463 if ((nfi = Fopen(tempname, "r")) == NULL) { in infix() 464 warn("%s", tempname); in infix() 466 (void)rm(tempname); in infix() 469 (void)rm(tempname); in infix() 484 warn("%s", tempname); in infix()
|
| H A D | lex.c | 66 char tempname[PATHSIZE]; in setfile() local 124 (void)snprintf(tempname, sizeof(tempname), in setfile() 126 if ((fd = mkstemp(tempname)) == -1 || (otf = fdopen(fd, "w")) == NULL) in setfile() 127 err(1, "%s", tempname); in setfile() 129 if ((itf = fopen(tempname, "r")) == NULL) in setfile() 130 err(1, "%s", tempname); in setfile() 132 (void)rm(tempname); in setfile()
|
| H A D | names.c | 305 char tempname[PATHSIZE]; in outof() local 307 (void)snprintf(tempname, sizeof(tempname), in outof() 309 if ((fd = mkstemp(tempname)) == -1 || in outof() 311 warn("%s", tempname); in outof() 315 image = open(tempname, O_RDWR); in outof() 316 (void)rm(tempname); in outof() 318 warn("%s", tempname); in outof() 333 warn("%s", tempname); in outof()
|
| /freebsd/sbin/ldconfig/ |
| H A D | elfhints.c | 270 char *tempname; in write_elf_hints() local 275 if (asprintf(&tempname, "%s.XXXXXX", hintsfile) == -1) in write_elf_hints() 277 if ((fd = mkstemp(tempname)) == -1) in write_elf_hints() 278 err(1, "mkstemp(%s)", tempname); in write_elf_hints() 280 err(1, "fchmod(%s)", tempname); in write_elf_hints() 282 err(1, "fdopen(%s)", tempname); in write_elf_hints() 304 err(1, "%s: write error", tempname); in write_elf_hints() 308 err(1, "%s: write error", tempname); in write_elf_hints() 311 err(1, "%s: write error", tempname); in write_elf_hints() 314 err(1, "%s: write error", tempname); in write_elf_hints() [all...] |
| /freebsd/lib/libutil/ |
| H A D | pw_util.c | 70 static char tempname[PATH_MAX]; variable 218 if (snprintf(tempname, sizeof(tempname), "%.*spw.XXXXXX", in pw_tmp() 219 (int)(p - masterpasswd), masterpasswd) >= (int)sizeof(tempname)) { in pw_tmp() 223 if ((tfd = mkostemp(tempname, 0)) == -1) in pw_tmp() 230 unlink(tempname); in pw_tmp() 231 *tempname = '\0'; in pw_tmp() 256 "-d", passwd_dir, tempname, (char *)NULL); in pw_mkdb() 259 "-d", passwd_dir, "-u", user, tempname, in pw_mkdb() 290 if (stat(tempname, &st1) == -1) in pw_edit() 313 execlp(editor, editor, tempname, (char *)NULL); in pw_edit() [all …]
|
| H A D | gr_util.c | 49 static char tempname[PATH_MAX]; variable 138 if (snprintf(tempname, sizeof(tempname), "%.*sgroup.XXXXXX", in gr_tmp() 139 (int)(p - group_file), group_file) >= (int)sizeof(tempname)) { in gr_tmp() 143 if ((tfd = mkostemp(tempname, 0)) == -1) in gr_tmp() 150 unlink(tempname); in gr_tmp() 151 *tempname = '\0'; in gr_tmp() 333 if (chmod(tempname, 0644) != 0) in gr_mkdb() 336 if (rename(tempname, group_file) != 0) in gr_mkdb() 367 if (*tempname != '\0') { in gr_fini() 368 unlink(tempname); in gr_fini() [all …]
|
| /freebsd/tools/test/stress2/misc/ |
| H A D | truncate6.sh | 102 char tempname[] = "file"; 105 if ((fd = open(tempname, O_WRONLY | O_CREAT | O_TRUNC, DEFFILEMODE)) == 107 err(1, "open(%s)", tempname);
|
| /freebsd/lib/libc/tests/gen/ |
| H A D | dlopen_empty_test.c | 57 char tempname[] = "/tmp/temp.XXXXXX"; in ATF_TC_BODY() local 63 fname = mktemp(tempname); in ATF_TC_BODY()
|
| /freebsd/contrib/less/ |
| H A D | cmdbuf.c | 1660 char *tempname = ecalloc(1, strlen(filename)+1); in make_tempname() local 1661 strcpy(tempname, filename); in make_tempname() 1662 lastch = tempname[strlen(tempname)-1]; in make_tempname() 1663 tempname[strlen(tempname)-1] = (lastch == 'Q') ? 'Z' : 'Q'; in make_tempname() 1664 return tempname; in make_tempname() 1760 char *tempname; in save_cmdhist() local 1773 tempname = make_tempname(histname); in save_cmdhist() 1774 fout = fopen(tempname, "w"); in save_cmdhist() 1802 rename(tempname, histname); in save_cmdhist() 1804 free(tempname); in save_cmdhist()
|
| /freebsd/contrib/unifdef/ |
| H A D | unifdef.c | 192 static char *tempname; /* avoid splatting input */ variable 424 tempname = astrcat(ofn, ".XXXXXX"); in processinout() 425 output = mktempmode(tempname, st.st_mode); in processinout() 427 err(2, "can't create %s", tempname); in processinout() 439 if (remove(tempname) < 0) in processinout() 440 warn("can't remove \"%s\"", tempname); in processinout() 441 } else if (replace(tempname, ofn) < 0) in processinout() 442 err(2, "can't rename \"%s\" to \"%s\"", tempname, ofn); in processinout() 443 free(tempname); in processinout() 444 tempname = NULL; in processinout() [all …]
|
| /freebsd/contrib/tzcode/ |
| H A D | zic.c | 652 char const *tempname) in close_file() argument 663 if (tempname) in close_file() 664 (void)remove(tempname); in close_file() 1400 open_outfile(char const **outname, char **tempname) in open_outfile() argument 1410 if (!*tempname) in open_outfile() 1411 random_dirent(outname, tempname); in open_outfile() 1427 random_dirent(outname, tempname); in open_outfile() 1443 rename_dest(char *tempname, char const *name) in rename_dest() argument 1445 if (tempname) { in rename_dest() 1446 if (rename(tempname, name) != 0) { in rename_dest() [all …]
|
| /freebsd/usr.sbin/kldxref/ |
| H A D | kldxref.c | 735 static char xrefname[MAXPATHLEN], tempname[MAXPATHLEN]; variable 818 rename(tempname, xrefname); in main() 821 unlink(tempname); in main() 831 fxref = maketempfile(tempname, ftsp->fts_path); in main() 833 err(1, "can't create %s", tempname); in main()
|
| /freebsd/contrib/diff/ |
| H A D | FREEBSD-Xlist | 44 lib/tempname.c
|
| H A D | ChangeLog | 680 (tempname): Use AC_LIBOBJS, not LIBOBJS=, as now required by autoconf. 708 lib/tempname.c: Update to latest version from other packages. 1677 * lib/tempname.c (uint64_t): 1682 * lib/tempname.c: glibc 1.32 1690 * lib/tempname.c (struct_stat64): New macro. 1694 * lib/tempname.c (<config.h>): Include if HAVE_CONFIG_H.
|
| /freebsd/crypto/openssl/apps/lib/ |
| H A D | opt.c | 1250 WCHAR tempname[MAX_PATH]; in opt_isdir() local 1256 if (!MultiByteToWideChar(CP_ACP, 0, name, len_0, tempname, MAX_PATH)) in opt_isdir() 1259 tempname[i] = (WCHAR)name[i]; in opt_isdir() 1261 attr = GetFileAttributes(tempname); in opt_isdir()
|
| /freebsd/tests/sys/kern/ |
| H A D | ssl_sendfile.c | 79 char tempname[] = "/tmp/ssl_sendfile_test.XXXXXXXXXX"; in common_init() local 122 ATF_REQUIRE((c->fd = mkstemp(tempname)) > 0); in common_init() 123 ATF_REQUIRE(unlink(tempname) == 0); in common_init()
|
| /freebsd/sbin/fsck_ffs/ |
| H A D | dir.c | 571 char tempname[BUFSIZ]; in linkup() local 662 (void)lftempname(tempname, orphan); in linkup() 663 if (makeentry(lfdir, orphan, (name ? name : tempname)) == 0) { in linkup()
|