From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7647 invoked from network); 18 Feb 2003 08:46:44 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 18 Feb 2003 08:46:44 -0000 Received: (qmail 29139 invoked by alias); 18 Feb 2003 08:46:35 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18255 Received: (qmail 29132 invoked from network); 18 Feb 2003 08:46:34 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 18 Feb 2003 08:46:34 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [65.206.41.66] by sunsite.dk (MessageWall 1.0.8) with SMTP; 18 Feb 2003 8:46:33 -0000 Received: from gauss.counterexample.org (gauss.counterexample.org [192.168.13.4]) by ns00.counterexample.org (8.12.5/8.11.2) with ESMTP id h1I8kZEC006910; Tue, 18 Feb 2003 03:46:35 -0500 Received: (from guthrie@localhost) by gauss.counterexample.org (8.11.6/8.11.6) id h1I8kZc12536; Tue, 18 Feb 2003 03:46:35 -0500 Date: Tue, 18 Feb 2003 03:46:35 -0500 From: "John T. Guthrie" Message-Id: <200302180846.h1I8kZc12536@gauss.counterexample.org> To: zsh-workers@sunsite.dk Subject: PATCH: small compilation cleanup for utils.c Cc: guthrie@counterexample.org Hello all, This is a very small patch to clean up compilation on RedHat Linux. (And, I believe on most anything that uses GLIBC >= 2.0, but I'm not certain of that.) When compiling on RedHat Linux 8.0, I get the compilation complaint: utils.o: In function `gettempname': utils.o(.text+0x1b1a): the use of `mktemp' is dangerous, better use `mkstemp' This patch fixes that for systems that have mktemp(), but not _mktemp(). I saw that configure was testing for both mkstemp() and _mktemp(), but the code only used _mktemp(). I don't know whether the test for HAVE_MKSTEMP should come before or after the test for HAVE__MKTEMP, so let me know if there is a different preferred order. John Guthrie guthrie@counterexample.org --------------------------BEGIN PATCH-------------------------------- *** utils.c.orig 2002-10-15 14:00:00.000000000 -0400 --- utils.c 2003-02-18 02:51:59.000000000 -0500 *************** *** 1108,1119 **** --- 1108,1123 ---- if (!(s = getsparam("TMPPREFIX"))) s = DEFAULT_TMPPREFIX; + #ifdef HAVE_MKSTEMP + ret = ((char *) mkstemp(dyncat(unmeta(s), "XXXXXX"))); + #else #ifdef HAVE__MKTEMP /* Zsh uses mktemp() safely, so silence the warnings */ ret = ((char *) _mktemp(dyncat(unmeta(s), "XXXXXX"))); #else ret = ((char *) mktemp(dyncat(unmeta(s), "XXXXXX"))); #endif + #endif unqueue_signals(); return ret;