From: root Date: Tue, 17 Sep 1996 19:14:00 +0000 (+0000) Subject: use TMPPATH var X-Git-Tag: tznext/4.11.0.1.tizen20130304~10930 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3337feba2f121c753855070ff190263a9349197e;p=tools%2Flibrpm-tizen.git use TMPPATH var CVS patchset: 1030 CVS date: 1996/09/17 19:14:00 --- diff --git a/checksig.c b/checksig.c index c046c49..4e25ded 100644 --- a/checksig.c +++ b/checksig.c @@ -48,7 +48,7 @@ int doReSign(int add, char *passPhrase, char **argv) } /* Write the rest to a temp file */ - strcpy(sigtarget, tmpnam(NULL)); + strcpy(sigtarget, tempnam(getVar(RPMVAR_TMPPATH), "rpmsigtarget")); ofd = open(sigtarget, O_WRONLY|O_CREAT|O_TRUNC, 0644); while ((count = read(fd, buffer, sizeof(buffer))) > 0) { if (count == -1) { @@ -172,7 +172,7 @@ int doCheckSig(int pgp, char **argv) continue; } /* Write the rest to a temp file */ - strcpy(sigtarget, tmpnam(NULL)); + strcpy(sigtarget, tempnam(getVar(RPMVAR_TMPPATH), "rpmsigtarget")); ofd = open(sigtarget, O_WRONLY|O_CREAT|O_TRUNC, 0644); while ((count = read(fd, buffer, sizeof(buffer))) > 0) { if (count == -1) { @@ -182,7 +182,8 @@ int doCheckSig(int pgp, char **argv) exit(1); } if (write(ofd, buffer, count) < 0) { - perror("Couldn't write header/archive to temp file"); + fprintf(stderr, "Unable to write %s", sigtarget); + perror(""); close(ofd); unlink(sigtarget); exit(1);