Correct the "unimplemented" message for get{host,net,proto,serv}ent aliases.
authorNicholas Clark <nick@ccl4.org>
Mon, 10 Jan 2011 15:15:25 +0000 (15:15 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 10 Jan 2011 15:15:25 +0000 (15:15 +0000)
Previously, if all of gethost{byaddr,byname,ent} were unimplemented on a
platform, they would all return 'Unsupported socket function "gethostent"
called', with the analogous results for getnet{byaddr,byname,ent},
getproto{byname,bynumber,ent} and getserv{byname,byport,ent}. This bug was
introduced by change af51a00e97d5c559 - prior to this, all 12 functions would
report their own name when unimplemented.

pp_sys.c

index a227369..73a5c8a 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4771,7 +4771,7 @@ PP(pp_ghostent)
     }
     RETURN;
 #else
-    DIE(aTHX_ PL_no_sock_func, "gethostent");
+    DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]);
 #endif
 }
 
@@ -4844,7 +4844,7 @@ PP(pp_gnetent)
 
     RETURN;
 #else
-    DIE(aTHX_ PL_no_sock_func, "getnetent");
+    DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]);
 #endif
 }
 
@@ -4904,7 +4904,7 @@ PP(pp_gprotoent)
 
     RETURN;
 #else
-    DIE(aTHX_ PL_no_sock_func, "getprotoent");
+    DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]);
 #endif
 }
 
@@ -4979,7 +4979,7 @@ PP(pp_gservent)
 
     RETURN;
 #else
-    DIE(aTHX_ PL_no_sock_func, "getservent");
+    DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]);
 #endif
 }