Lines Matching defs:tempfile
66 static char tempfile[MAXNAMESIZE];
74 (void) sprintf(tempfile, "%s/LTMP.%ld", X_LOCKDIR, (long) getpid());
84 if (onelock(pid, tempfile, name) == -1) {
85 (void) unlink(tempfile);
89 if (onelock(pid, tempfile, name)) {
90 (void) unlink(tempfile);
289 * tempfile - name of a temporary in the same file system
296 onelock(pid,tempfile,name)
298 char *tempfile, *name;
303 fd=creat(tempfile, (mode_t) 0444);
305 (void) sprintf(cb, "%s %s %d",tempfile, name, errno);
308 (void) unlink(tempfile);
313 (void) sprintf(cb, "%s %s %d",tempfile, name, errno);
315 (void) unlink(tempfile);
318 (void) chmod(tempfile, (mode_t) 0444);
319 (void) chown(tempfile, UUCPUID, UUCPGID);
321 if(link(tempfile,name)<0){
323 DEBUG(4, "link(%s, ", tempfile);
325 if(unlink(tempfile)< 0){
326 (void) sprintf(cb, "ULK err %s %d", tempfile, errno);
331 if(unlink(tempfile)<0){
332 (void) sprintf(cb, "%s %d",tempfile,errno);