/* util.c
*
- * Copyright (c) 1991-2000, Larry Wall
+ * Copyright (c) 1991-2001, Larry Wall
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
if (! newcoll) {
if (PL_collation_name) {
- PL_collation_ix++;
+ ++PL_collation_ix;
Safefree(PL_collation_name);
PL_collation_name = NULL;
}
}
if (! PL_collation_name || strNE(PL_collation_name, newcoll)) {
- PL_collation_ix++;
- if (PL_collation_name)
- Safefree(PL_collation_name);
- PL_collation_name = stdize_locale(newcoll);
+ ++PL_collation_ix;
+ Safefree(PL_collation_name);
+ PL_collation_name = stdize_locale(savepv(newcoll));
PL_collation_standard = (strEQ(newcoll, "C") || strEQ(newcoll, "POSIX"));
{
}
if (! PL_numeric_name || strNE(PL_numeric_name, newnum)) {
- if (PL_numeric_name)
- Safefree(PL_numeric_name);
- PL_numeric_name = stdize_locale(newnum);
+ Safefree(PL_numeric_name);
+ PL_numeric_name = stdize_locale(savepv(newnum));
PL_numeric_standard = (strEQ(newnum, "C") || strEQ(newnum, "POSIX"));
PL_numeric_local = TRUE;
set_numeric_radix();
PerlLIO_close(pp[0]);
did_pipes = 0;
if (n) { /* Error */
+ int pid2, status;
if (n != sizeof(int))
Perl_croak(aTHX_ "panic: kid popen errno read");
+ do {
+ pid2 = wait4pid(pid, &status, 0);
+ } while (pid2 == -1 && errno == EINTR);
errno = errkid; /* Propagate errno from kid */
return Nullfp;
}
LOCK_FDPID_MUTEX;
svp = av_fetch(PL_fdpid,PerlIO_fileno(ptr),TRUE);
UNLOCK_FDPID_MUTEX;
- pid = SvIVX(*svp);
+ pid = SvIV(*svp);
+ if (!pid)
+ return 0;
SvREFCNT_dec(*svp);
*svp = &PL_sv_undef;
#ifdef OS2