Lines Matching refs:tempfile
56 static char *tempfile;
59 tempfile = malloc(MAXNAMESIZE);
60 if (tempfile == NULL)
63 (void) snprintf(tempfile, MAXNAMESIZE, "%s/LTMP.%ld", X_LOCKDIR,
67 if (onelock(pid, tempfile, name) == -1) {
68 (void) unlink(tempfile);
72 if (onelock(pid, tempfile, name)) {
73 (void) unlink(tempfile);
189 * tempfile - name of a temporary in the same file system
196 onelock(char *pid, char *tempfile, char *name)
201 fd = creat(tempfile, (mode_t)0444);
204 "%s %s %d", tempfile, name, errno);
207 (void) unlink(tempfile);
213 "%s %s %d", tempfile, name, errno);
215 (void) unlink(tempfile);
218 (void) chmod(tempfile, (mode_t)0444);
219 (void) chown(tempfile, UUCPUID, UUCPGID);
221 if (link(tempfile, name) < 0) {
223 DEBUG(4, "link(%s, ", tempfile);
225 if (unlink(tempfile) < 0) {
227 "ULK err %s %d", tempfile, errno);
232 if (unlink(tempfile) < 0) {
233 (void) snprintf(cb, sizeof (cb), "%s %d", tempfile, errno);