diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-01-10 10:29:06 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-01-10 11:39:34 +0000 |
commit | 396166e10147fc6b88509af7c63dd916a683a86c (patch) | |
tree | c6a827e12bca7e7fd483e9e7b0f700c4686f3eae /pp_sys.c | |
parent | d8ef1fcdce21e8d5905a1ed77bc1caa307b2b79e (diff) | |
download | perl-396166e10147fc6b88509af7c63dd916a683a86c.tar.gz |
Merge the implementations of pp_s{host,net,proto,serv}ent.
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 49 |
1 files changed, 21 insertions, 28 deletions
@@ -4985,46 +4985,39 @@ PP(pp_gservent) PP(pp_shostent) { -#ifdef HAS_SETHOSTENT dVAR; dSP; - PerlSock_sethostent(TOPi); - RETSETYES; + const int stayopen = TOPi; + switch(PL_op->op_type) { + case OP_SHOSTENT: +#ifdef HAS_SETHOSTENT + PerlSock_sethostent(stayopen); #else - DIE(aTHX_ PL_no_sock_func, "sethostent"); + DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]); #endif -} - -PP(pp_snetent) -{ + break; #ifdef HAS_SETNETENT - dVAR; dSP; - (void)PerlSock_setnetent(TOPi); - RETSETYES; + case OP_SNETENT: + PerlSock_setnetent(stayopen); #else - DIE(aTHX_ PL_no_sock_func, "setnetent"); + DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]); #endif -} - -PP(pp_sprotoent) -{ + break; + case OP_SPROTOENT: #ifdef HAS_SETPROTOENT - dVAR; dSP; - (void)PerlSock_setprotoent(TOPi); - RETSETYES; + PerlSock_setprotoent(stayopen); #else - DIE(aTHX_ PL_no_sock_func, "setprotoent"); + DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]); #endif -} - -PP(pp_sservent) -{ + break; + case OP_SSERVENT: #ifdef HAS_SETSERVENT - dVAR; dSP; - (void)PerlSock_setservent(TOPi); - RETSETYES; + PerlSock_setservent(stayopen); #else - DIE(aTHX_ PL_no_sock_func, "setservent"); + DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]); #endif + break; + } + RETSETYES; } PP(pp_ehostent) |