diff options
Diffstat (limited to 'moduli.c')
-rw-r--r-- | moduli.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: moduli.c,v 1.24 2011/10/16 15:51:39 stsp Exp $ */ | 1 | /* $OpenBSD: moduli.c,v 1.25 2011/10/19 00:06:10 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright 1994 Phil Karn <karn@qualcomm.com> | 3 | * Copyright 1994 Phil Karn <karn@qualcomm.com> |
4 | * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com> | 4 | * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com> |
@@ -445,16 +445,16 @@ static void | |||
445 | write_checkpoint(char *cpfile, u_int32_t lineno) | 445 | write_checkpoint(char *cpfile, u_int32_t lineno) |
446 | { | 446 | { |
447 | FILE *fp; | 447 | FILE *fp; |
448 | char tmpfile[MAXPATHLEN]; | 448 | char tmp[MAXPATHLEN]; |
449 | int r; | 449 | int r; |
450 | 450 | ||
451 | r = snprintf(tmpfile, sizeof(tmpfile), "%s.XXXXXXXXXX", cpfile); | 451 | r = snprintf(tmp, sizeof(tmp), "%s.XXXXXXXXXX", cpfile); |
452 | if (r == -1 || r >= MAXPATHLEN) { | 452 | if (r == -1 || r >= MAXPATHLEN) { |
453 | logit("write_checkpoint: temp pathname too long"); | 453 | logit("write_checkpoint: temp pathname too long"); |
454 | return; | 454 | return; |
455 | } | 455 | } |
456 | if ((r = mkstemp(tmpfile)) == -1) { | 456 | if ((r = mkstemp(tmp)) == -1) { |
457 | logit("mkstemp(%s): %s", tmpfile, strerror(errno)); | 457 | logit("mkstemp(%s): %s", tmp, strerror(errno)); |
458 | return; | 458 | return; |
459 | } | 459 | } |
460 | if ((fp = fdopen(r, "w")) == NULL) { | 460 | if ((fp = fdopen(r, "w")) == NULL) { |
@@ -463,7 +463,7 @@ write_checkpoint(char *cpfile, u_int32_t lineno) | |||
463 | return; | 463 | return; |
464 | } | 464 | } |
465 | if (fprintf(fp, "%lu\n", (unsigned long)lineno) > 0 && fclose(fp) == 0 | 465 | if (fprintf(fp, "%lu\n", (unsigned long)lineno) > 0 && fclose(fp) == 0 |
466 | && rename(tmpfile, cpfile) == 0) | 466 | && rename(tmp, cpfile) == 0) |
467 | debug3("wrote checkpoint line %lu to '%s'", | 467 | debug3("wrote checkpoint line %lu to '%s'", |
468 | (unsigned long)lineno, cpfile); | 468 | (unsigned long)lineno, cpfile); |
469 | else | 469 | else |