}
else {
GV *thatgv;
- thatgv = gv_fetchpv(type,FALSE,SVt_PVIO);
+ thatgv = gv_fetchpv(type,0,SVt_PVIO);
thatio = GvIO(thatgv);
}
if (!thatio) {
report_evil_fh(gv, io, OP_phoney_OUTPUT_ONLY);
while (IoIFP(io)) {
- int saverrno;
- int ch;
-
if (PerlIO_has_cntptr(IoIFP(io))) { /* (the code works without this) */
if (PerlIO_get_cnt(IoIFP(io)) > 0) /* cheat a little, since */
return FALSE; /* this is the most usual case */
}
- saverrno = errno; /* getc and ungetc can stomp on errno */
- ch = PerlIO_getc(IoIFP(io));
- if (ch != EOF) {
- (void)PerlIO_ungetc(IoIFP(io),ch);
+ {
+ /* getc and ungetc can stomp on errno */
+ const int saverrno = errno;
+ const int ch = PerlIO_getc(IoIFP(io));
+ if (ch != EOF) {
+ (void)PerlIO_ungetc(IoIFP(io),ch);
+ errno = saverrno;
+ return FALSE;
+ }
errno = saverrno;
- return FALSE;
}
- errno = saverrno;
if (PerlIO_has_cntptr(IoIFP(io)) && PerlIO_canset_cnt(IoIFP(io))) {
if (PerlIO_get_cnt(IoIFP(io)) < -1)
Perl_warner(aTHX_ packWARN(WARN_EXEC), "Can't exec \"%s\": %s",
(really ? tmps : PL_Argv[0]), Strerror(errno));
if (do_report) {
- int e = errno;
+ const int e = errno;
PerlLIO_write(fd, (void*)&e, sizeof(int));
PerlLIO_close(fd);
Perl_warner(aTHX_ packWARN(WARN_EXEC), "Can't exec \"%s\": %s",
PL_Argv[0], Strerror(errno));
if (do_report) {
- int e = errno;
+ const int e = errno;
PerlLIO_write(fd, (void*)&e, sizeof(int));
PerlLIO_close(fd);
}
{
register I32 val;
register I32 tot = 0;
- const char *what;
+ const char *const what = PL_op_name[type];
const char *s;
SV ** const oldmark = mark;
platforms where kill was not defined. */
#ifndef HAS_KILL
if (type == OP_KILL)
- Perl_die(aTHX_ PL_no_func, "kill");
+ Perl_die(aTHX_ PL_no_func, what);
#endif
#ifndef HAS_CHOWN
if (type == OP_CHOWN)
- Perl_die(aTHX_ PL_no_func, "chown");
+ Perl_die(aTHX_ PL_no_func, what);
#endif
}
switch (type) {
case OP_CHMOD:
- what = "chmod";
APPLY_TAINT_PROPER();
if (++mark <= sp) {
val = SvIVx(*mark);
break;
#ifdef HAS_CHOWN
case OP_CHOWN:
- what = "chown";
APPLY_TAINT_PROPER();
if (sp - mark > 2) {
register I32 val2;
*/
#ifdef HAS_KILL
case OP_KILL:
- what = "kill";
APPLY_TAINT_PROPER();
if (mark == sp)
break;
break;
#endif
case OP_UNLINK:
- what = "unlink";
APPLY_TAINT_PROPER();
tot = sp - mark;
while (++mark <= sp) {
break;
#if defined(HAS_UTIME) || defined(HAS_FUTIMES)
case OP_UTIME:
- what = "utime";
APPLY_TAINT_PROPER();
if (sp - mark > 2) {
#if defined(HAS_FUTIMES)