diff options
author | osa <osa@FreeBSD.org> | 2003-07-14 23:09:01 +0800 |
---|---|---|
committer | osa <osa@FreeBSD.org> | 2003-07-14 23:09:01 +0800 |
commit | 69ceef4074365856b72806ef5997ab4d1b2eef77 (patch) | |
tree | b6c341aa06e7f2466f942f1d23fc69a8bc3df7a6 /devel | |
parent | 8ed747d70e25b43ad43f379d48e11ac3deca2e4b (diff) | |
download | freebsd-ports-gnome-69ceef4074365856b72806ef5997ab4d1b2eef77.tar.gz freebsd-ports-gnome-69ceef4074365856b72806ef5997ab4d1b2eef77.tar.zst freebsd-ports-gnome-69ceef4074365856b72806ef5997ab4d1b2eef77.zip |
Update to 1.4
Use mkstemp() instead of tmpnam()
Submitted by: Volker Stolz <stolz@i2.informatik.rwth-aachen.de>
PR: 54012
Diffstat (limited to 'devel')
-rw-r--r-- | devel/mk/Makefile | 2 | ||||
-rw-r--r-- | devel/mk/distinfo | 2 | ||||
-rw-r--r-- | devel/mk/files/patch-src::Posix.c | 18 | ||||
-rw-r--r-- | devel/mk/files/patch-src::main.c | 53 |
4 files changed, 73 insertions, 2 deletions
diff --git a/devel/mk/Makefile b/devel/mk/Makefile index 6632d10b5537..9f4b607b3ff5 100644 --- a/devel/mk/Makefile +++ b/devel/mk/Makefile @@ -6,7 +6,7 @@ # PORTNAME= mk -PORTVERSION= 1.3 +PORTVERSION= 1.4 CATEGORIES= devel MASTER_SITES= http://www.cminusminus.org/download/ diff --git a/devel/mk/distinfo b/devel/mk/distinfo index 0eff1468326c..8443933fe360 100644 --- a/devel/mk/distinfo +++ b/devel/mk/distinfo @@ -1 +1 @@ -MD5 (mk-1.3.tar.gz) = b8c5b1beadecfb9a0330c27db8f14f44 +MD5 (mk-1.4.tar.gz) = a7ce754eee8b5125209cdbd68cf3a4ce diff --git a/devel/mk/files/patch-src::Posix.c b/devel/mk/files/patch-src::Posix.c new file mode 100644 index 000000000000..1e2b3dbe77d8 --- /dev/null +++ b/devel/mk/files/patch-src::Posix.c @@ -0,0 +1,18 @@ +--- src/Posix.c.orig Thu Jul 3 16:08:16 2003 ++++ src/Posix.c Thu Jul 3 16:08:31 2003 +@@ -276,14 +276,6 @@ + signal(sigmsgs[i].sig, notifyf); + } + +-char* +-maketmp(void) +-{ +- static char temp[L_tmpnam]; +- +- return tmpnam(temp); +-} +- + int + chgtime(char *name) + { + diff --git a/devel/mk/files/patch-src::main.c b/devel/mk/files/patch-src::main.c new file mode 100644 index 000000000000..50c5214e98de --- /dev/null +++ b/devel/mk/files/patch-src::main.c @@ -0,0 +1,53 @@ +--- src/main.c.orig Wed Jun 5 17:30:39 2002 ++++ src/main.c Thu Jul 3 18:34:19 2003 +@@ -33,7 +33,7 @@ + main(int argc, char **argv) + { + Word *w; +- char *s, *temp; ++ char *s; + char *files[256], **f = files, **ff; + int sflag = 0; + int i; +@@ -41,6 +41,8 @@ + Biobuf tb; + Bufblock *buf; + Bufblock *whatif; ++ char TMPLATE[14]; ++ (void)strncpy(TMPLATE,"/tmp/mk.XXXXX", sizeof(TMPLATE)); + + /* + * start with a copy of the current environment variables +@@ -133,21 +135,15 @@ + /* + assignment args become null strings + */ +- temp = 0; + for(i = 0; argv[i]; i++) if(utfrune(argv[i], '=')){ + bufcpy(buf, argv[i], strlen(argv[i])); + insert(buf, ' '); + if(tfd < 0){ +- temp = maketmp(); +- if(temp == 0) { +- perror("temp file"); +- Exit(); +- } +- close(create(temp, OWRITE, 0600)); +- if((tfd = open(temp, 2)) < 0){ +- perror(temp); ++ if ((tfd = mkstemp(TMPLATE)) < 0){ ++ perror(TMPLATE); + Exit(); + } ++ unlink(TMPLATE); + Binit(&tb, tfd, OWRITE); + } + Bprint(&tb, "%s\n", argv[i]); +@@ -157,7 +153,6 @@ + Bflush(&tb); + LSEEK(tfd, 0L, 0); + parse("command line args", tfd, 1); +- remove(temp); + } + + if (buf->current != buf->start) { |