summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-08-06 01:33:55 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-08-06 01:33:55 +0000
commit2dd78f96d61cc6382dc72214930c993567209597 (patch)
tree86ec042cca52df9fdf32e1d4aaf99c1e57077661 /util.c
parentc9166e37736ce050b2ee05d4fdf16697211280ca (diff)
downloadperl-2dd78f96d61cc6382dc72214930c993567209597.tar.gz
Continue fixing the io warnings. This also
sort of fixes bug ID 20000802.003: the core dump is no more. Whether the current behaviour is correct (giving a warning: "Not a format reference"), is another matter. p4raw-id: //depot/perl@6531
Diffstat (limited to 'util.c')
-rw-r--r--util.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/util.c b/util.c
index 6eda3fe060..2e923c5a7e 100644
--- a/util.c
+++ b/util.c
@@ -3897,12 +3897,12 @@ Perl_report_evil_fh(pTHX_ GV *gv, IO *io, I32 op)
op == OP_LEAVEWRITE ? "write" :
PL_op_desc[op];
char *pars = OP_IS_FILETEST(op) ? "" : "()";
- char *type = OP_IS_SOCKET(op) ? "socket" : "filehandle";
+ char *type = OP_IS_SOCKET(op) || (io && IoTYPE(io) == 's') ?
+ "socket" : "filehandle";
char *name = NULL;
if (isGV(gv)) {
SV *sv = sv_newmortal();
-
gv_efullname4(sv, gv, Nullch, FALSE);
name = SvPVX(sv);
}
@@ -3910,19 +3910,21 @@ Perl_report_evil_fh(pTHX_ GV *gv, IO *io, I32 op)
if (io && IoTYPE(io) == ' ') {
vile = "closed";
warn = WARN_CLOSED;
- } else {
+ }
+ else {
vile = "unopened";
warn = WARN_UNOPENED;
}
- if (name) {
+ if (name && *name) {
Perl_warner(aTHX_ warn,
"%s%s on %s %s %s", func, pars, vile, type, name);
if (io && IoDIRP(io))
Perl_warner(aTHX_ warn,
"\t(Are you trying to call %s%s on dirhandle %s?)\n",
func, pars, name);
- } else {
+ }
+ else {
Perl_warner(aTHX_ warn,
"%s%s on %s %s", func, pars, vile, type);
if (io && IoDIRP(io))