Lines Matching defs:tempfile
67 static char tempfile[MAXNAMESIZE];
75 (void) sprintf(tempfile, "%s/LTMP.%ld", X_LOCKDIR, (long) getpid());
85 if (onelock(pid, tempfile, name) == -1) {
86 (void) unlink(tempfile);
90 if (onelock(pid, tempfile, name)) {
91 (void) unlink(tempfile);
290 * tempfile - name of a temporary in the same file system
297 onelock(pid,tempfile,name)
299 char *tempfile, *name;
304 fd=creat(tempfile, (mode_t) 0444);
306 (void) sprintf(cb, "%s %s %d",tempfile, name, errno);
309 (void) unlink(tempfile);
314 (void) sprintf(cb, "%s %s %d",tempfile, name, errno);
316 (void) unlink(tempfile);
319 (void) chmod(tempfile, (mode_t) 0444);
320 (void) chown(tempfile, UUCPUID, UUCPGID);
322 if(link(tempfile,name)<0){
324 DEBUG(4, "link(%s, ", tempfile);
326 if(unlink(tempfile)< 0){
327 (void) sprintf(cb, "ULK err %s %d", tempfile, errno);
332 if(unlink(tempfile)<0){
333 (void) sprintf(cb, "%s %d",tempfile,errno);