summaryrefslogtreecommitdiff
path: root/moduli.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2011-11-04 10:52:43 +1100
committerDarren Tucker <dtucker@zip.com.au>2011-11-04 10:52:43 +1100
commit9ee09cfce6c375f6a52c916803577481227189ba (patch)
tree4b380e0065b8467d87fe5e47eded1d1c0553ed67 /moduli.c
parente68cf84ac873f0b3fd566c55d6a915fd7843e76b (diff)
- djm@cvs.openbsd.org 2011/10/19 00:06:10
[moduli.c] s/tmpfile/tmp/ to make this -Wshadow clean
Diffstat (limited to 'moduli.c')
-rw-r--r--moduli.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/moduli.c b/moduli.c
index 0d3948a44..973ee6288 100644
--- a/moduli.c
+++ b/moduli.c
@@ -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
445write_checkpoint(char *cpfile, u_int32_t lineno) 445write_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