Lines Matching defs:tempfile
260 char *p, tempfile[MAXPATHLEN + 1];
267 strncpy(tempfile, filename, MAXPATHLEN);
268 tempfile[MAXPATHLEN] = '\0';
269 if ((p = strrchr(tempfile, '/')) == NULL) {
270 strcpy(tempfile, TPCTL_TMP_FILENAME);
274 p - tempfile + strlen(TPCTL_TMP_FILENAME))
276 strcat(tempfile, TPCTL_TMP_FILENAME);
278 if ((fd = open(tempfile, O_RDWR|O_CREAT|O_EXCL, 0644)) < 0) {
280 getprogname(), tempfile);
307 if (rename(tempfile, filename) < 0) {
308 unlink(tempfile);