if (!fp) {
dTHR;
if (ckWARN(WARN_NEWLINE) && IoTYPE(io) == '<' && strchr(name, '\n'))
- warner(WARN_NEWLINE, warn_nl, "open");
+ warner(WARN_NEWLINE, PL_warn_nl, "open");
goto say_false;
}
if (IoTYPE(io) &&
PerlIO_clearerr(fp);
}
#if defined(HAS_FCNTL) && defined(F_SETFD)
- fd = PerlIO_fileno(fp);
- fcntl(fd,F_SETFD,fd > PL_maxsysfd);
+ {
+ int save_errno = errno;
+ fd = PerlIO_fileno(fp);
+ fcntl(fd,F_SETFD,fd > PL_maxsysfd); /* can change errno */
+ errno = save_errno;
+ }
#endif
IoIFP(io) = fp;
if (writing) {
}
else
PerlIO_printf(PerlIO_stderr(), "Can't open %s: %s\n",
- SvPV(sv, PL_na), Strerror(errno));
+ SvPV(sv, oldlen), Strerror(errno));
}
if (PL_inplace) {
(void)do_close(PL_argvoutgv,FALSE);
return FALSE;
}
-long
-do_sysseek(GV *gv, long int pos, int whence)
+Off_t
+do_sysseek(GV *gv, Off_t pos, int whence)
{
register IO *io;
register PerlIO *fp;
{
dTHR;
if (ckWARN(WARN_UNINITIALIZED))
- warner(WARN_UNINITIALIZED, warn_uninit);
+ warner(WARN_UNINITIALIZED, PL_warn_uninit);
}
return TRUE;
case SVt_IV:
else {
SV* sv = POPs;
char *s;
+ STRLEN n_a;
PUTBACK;
if (SvTYPE(sv) == SVt_PVGV) {
tmpgv = (GV*)sv;
goto do_fstat;
}
- s = SvPV(sv, PL_na);
+ s = SvPV(sv, n_a);
PL_statgv = Nullgv;
sv_setpv(PL_statname, s);
PL_laststype = OP_STAT;
PL_laststatval = PerlLIO_stat(s, &PL_statcache);
if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(s, '\n'))
- warner(WARN_NEWLINE, warn_nl, "stat");
+ warner(WARN_NEWLINE, PL_warn_nl, "stat");
return PL_laststatval;
}
}
{
djSP;
SV *sv;
+ STRLEN n_a;
if (PL_op->op_flags & OPf_REF) {
EXTEND(SP,1);
if (cGVOP->op_gv == PL_defgv) {
PL_statgv = Nullgv;
sv = POPs;
PUTBACK;
- sv_setpv(PL_statname,SvPV(sv, PL_na));
+ sv_setpv(PL_statname,SvPV(sv, n_a));
#ifdef HAS_LSTAT
- PL_laststatval = PerlLIO_lstat(SvPV(sv, PL_na),&PL_statcache);
+ PL_laststatval = PerlLIO_lstat(SvPV(sv, n_a),&PL_statcache);
#else
- PL_laststatval = PerlLIO_stat(SvPV(sv, PL_na),&PL_statcache);
+ PL_laststatval = PerlLIO_stat(SvPV(sv, n_a),&PL_statcache);
#endif
- if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(SvPV(sv, PL_na), '\n'))
- warner(WARN_NEWLINE, warn_nl, "lstat");
+ if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(SvPV(sv, n_a), '\n'))
+ warner(WARN_NEWLINE, PL_warn_nl, "lstat");
return PL_laststatval;
}
{
register char **a;
char *tmps;
+ STRLEN n_a;
if (sp > mark) {
dTHR;
a = PL_Argv;
while (++mark <= sp) {
if (*mark)
- *a++ = SvPVx(*mark, PL_na);
+ *a++ = SvPVx(*mark, n_a);
else
*a++ = "";
}
*a = Nullch;
if (*PL_Argv[0] != '/') /* will execvp use PATH? */
TAINT_ENV(); /* testing IFS here is overkill, probably */
- if (really && *(tmps = SvPV(really, PL_na)))
+ if (really && *(tmps = SvPV(really, n_a)))
PerlProc_execvp(tmps,PL_Argv);
else
PerlProc_execvp(PL_Argv[0],PL_Argv);
char *what;
char *s;
SV **oldmark = mark;
+ STRLEN n_a;
#define APPLY_TAINT_PROPER() \
STMT_START { \
APPLY_TAINT_PROPER();
tot = sp - mark;
while (++mark <= sp) {
- char *name = SvPVx(*mark, PL_na);
+ char *name = SvPVx(*mark, n_a);
APPLY_TAINT_PROPER();
if (PerlLIO_chmod(name, val))
tot--;
APPLY_TAINT_PROPER();
tot = sp - mark;
while (++mark <= sp) {
- char *name = SvPVx(*mark, PL_na);
+ char *name = SvPVx(*mark, n_a);
APPLY_TAINT_PROPER();
if (PerlLIO_chown(name, val, val2))
tot--;
APPLY_TAINT_PROPER();
if (mark == sp)
break;
- s = SvPVx(*++mark, PL_na);
+ s = SvPVx(*++mark, n_a);
if (isUPPER(*s)) {
if (*s == 'S' && s[1] == 'I' && s[2] == 'G')
s += 3;
APPLY_TAINT_PROPER();
tot = sp - mark;
while (++mark <= sp) {
- s = SvPVx(*mark, PL_na);
+ s = SvPVx(*mark, n_a);
APPLY_TAINT_PROPER();
if (PL_euid || PL_unsafe) {
if (UNLINK(s))
APPLY_TAINT_PROPER();
tot = sp - mark;
while (++mark <= sp) {
- char *name = SvPVx(*mark, PL_na);
+ char *name = SvPVx(*mark, n_a);
APPLY_TAINT_PROPER();
if (PerlLIO_utime(name, &utbuf))
tot--;
#endif
#if !defined(HAS_MSG) || !defined(HAS_SEM) || !defined(HAS_SHM)
default:
- croak("%s not implemented", op_desc[optype]);
+ croak("%s not implemented", PL_op_desc[optype]);
#endif
}
return -1; /* should never happen */
#endif
#if !defined(HAS_MSG) || !defined(HAS_SEM) || !defined(HAS_SHM)
default:
- croak("%s not implemented", op_desc[optype]);
+ croak("%s not implemented", PL_op_desc[optype]);
#endif
}
a = SvPV(astr, len);
if (len != infosize)
croak("Bad arg length for %s, is %lu, should be %ld",
- op_desc[optype], (unsigned long)len, (long)infosize);
+ PL_op_desc[optype],
+ (unsigned long)len,
+ (long)infosize);
}
}
else