Lines Matching refs:fn

75 krb5_rc_io_creat(krb5_context context, krb5_rc_iostuff *d, char **fn)
85 if (fn && *fn)
88 if (*fn[0] == '/') {
89 d->fn = strdup(*fn);
90 if (d->fn == NULL)
93 if (!(d->fn = malloc(strlen(*fn) + dirlen + 1)))
95 (void) strcpy(d->fn, dir);
96 (void) strcat(d->fn, PATH_SEPARATOR);
97 (void) strcat(d->fn, *fn);
99 d->fd = THREEPARAMOPEN(d->fn, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL |
106 if (!(d->fn = malloc(30 + dirlen)))
108 if (fn)
109 if (!(*fn = malloc(35))) {
110 FREE_RC(d->fn);
113 (void) sprintf(d->fn, "%s%skrb5_RC%d", dir, PATH_SEPARATOR,
115 c = d->fn + strlen(d->fn);
117 while ((d->fd = THREEPARAMOPEN(d->fn, O_WRONLY | O_CREAT | O_TRUNC |
131 if (fn)
132 (void) strcpy(*fn, d->fn + dirlen);
158 d->fn ? d->fn : "<null>",
168 d->fn ? d->fn : "<null>",
182 if (d->fn) {
184 (void) unlink(d->fn);
185 FREE_RC(d->fn);
186 d->fn = NULL;
196 krb5_rc_io_open_internal(krb5_context context, krb5_rc_iostuff *d, char *fn,
208 if (fn[0] == '/') {
209 d->fn = strdup(fn);
210 if (d->fn == NULL)
213 if (!(d->fn = malloc(strlen(fn) + dirlen + 1)))
215 (void) strcpy(d->fn, dir);
216 (void) strcat(d->fn, PATH_SEPARATOR);
217 (void) strcat(d->fn, fn);
221 if ((d->fd = THREEPARAMOPEN(d->fn, O_RDWR|O_BINARY, 0600)) == -1) {
247 if (lstat(d->fn, &lstatb) == 0) {
258 "and should be removed.\n", d->fn);
305 d->fn, strerror(errno));
313 d->fn, strerror(errno));
318 if (d->fn) {
320 (void) unlink(d->fn);
321 FREE_RC(d->fn);
322 d->fn = NULL;
331 krb5_rc_io_open(krb5_context context, krb5_rc_iostuff *d, char *fn)
333 return krb5_rc_io_open_internal(context, d, fn, NULL);
369 new_fn = new1->fn;
370 new1->fn = NULL;
376 old_fn = old->fn;
377 old->fn = NULL;
400 char *fn = NULL;
401 if (rename(old->fn, new1->fn) == -1) /* MUST be atomic! */
403 fn = new1->fn;
404 new1->fn = NULL; /* avoid clobbering */
406 new1->fn = fn;
427 d->fn, strerror(errno));
433 d->fn, strerror(errno));
440 d->fn, strerror(errno));
463 d->fn, strerror(errno));
485 d->fn, strerror(errno));
497 if (d->fn != NULL) {
498 FREE_RC(d->fn);
499 d->fn = NULL;
513 if (unlink(d->fn) == -1)
520 d->fn, strerror(errno));
528 d->fn, strerror(errno));
535 d->fn, strerror(errno));