From: Steven N. Hirsch Date: Mon, 28 Jun 1999 14:23:59 +0000 (-0400) Subject: slightly modified version of suggested patch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=33f01dd10fdacfa5ccb83c4f933cacb0f65b707e;p=p5sagit%2Fp5-mst-13.2.git slightly modified version of suggested patch Message-Id: <199906281823.OAA24912@stargate.btv.ibm.com> Subject: [ID 19990628.007] POSIX::tmpnam() broken for threaded 5.00503 p4raw-id: //depot/perl@3641 --- diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 9702923..bbf9a7a 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -1526,9 +1526,10 @@ constant(char *name, int arg) #else goto not_there; #endif - if (strEQ(name, "L_tmpname")) -#ifdef L_tmpname - return L_tmpname; + /* L_tmpnam[e] was a typo--retained for compatibility */ + if (strEQ(name, "L_tmpname") || strEQ(name, "L_tmpnam")) +#ifdef L_tmpnam + return L_tmpnam; #else goto not_there; #endif @@ -3374,9 +3375,18 @@ write(fd, buffer, nbytes) char * buffer size_t nbytes -char * -tmpnam(s = 0) - char * s = 0; +SV * +tmpnam() + PREINIT: + STRLEN i; + int len; + CODE: + RETVAL = newSVpvn("", 0); + SvGROW(RETVAL, L_tmpnam); + len = strlen(tmpnam(SvPV(RETVAL, i))); + SvCUR_set(RETVAL, len); + OUTPUT: + RETVAL void abort()