diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-01-10 11:54:28 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-01-10 11:54:28 +0000 |
commit | 720d5dbf0d947286fddc718fa10dcc1b55949caf (patch) | |
tree | 86774b9f32e24aba00ed60d62849ef7d56433f96 /pp_sys.c | |
parent | 396166e10147fc6b88509af7c63dd916a683a86c (diff) | |
download | perl-720d5dbf0d947286fddc718fa10dcc1b55949caf.tar.gz |
Merge the implementations of {end,set}{gr,pw}ent with endhostent.
Unlike set{host,net,proto,serv}ent, set{gr,pw}ent don't have stayopen
parameter, hence their "signature" is the same as the ent*ent functions.
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 72 |
1 files changed, 28 insertions, 44 deletions
@@ -5052,6 +5052,34 @@ PP(pp_ehostent) DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]); #endif break; + case OP_SGRENT: +#if defined(HAS_GROUP) && defined(HAS_SETGRENT) + setgrent(); +#else + DIE(aTHX_ PL_no_func, PL_op_desc[PL_op->op_type]); +#endif + break; + case OP_EGRENT: +#if defined(HAS_GROUP) && defined(HAS_ENDGRENT) + endgrent(); +#else + DIE(aTHX_ PL_no_func, PL_op_desc[PL_op->op_type]); +#endif + break; + case OP_SPWENT: +#if defined(HAS_PASSWD) && defined(HAS_SETPWENT) + setpwent(); +#else + DIE(aTHX_ PL_no_func, PL_op_desc[PL_op->op_type]); +#endif + break; + case OP_EPWENT: +#if defined(HAS_PASSWD) && defined(HAS_ENDPWENT) + endpwent(); +#else + DIE(aTHX_ PL_no_func, PL_op_desc[PL_op->op_type]); +#endif + break; } EXTEND(SP,1); RETPUSHYES; @@ -5290,28 +5318,6 @@ PP(pp_gpwent) #endif } -PP(pp_spwent) -{ -#if defined(HAS_PASSWD) && defined(HAS_SETPWENT) - dVAR; dSP; - setpwent(); - RETPUSHYES; -#else - DIE(aTHX_ PL_no_func, "setpwent"); -#endif -} - -PP(pp_epwent) -{ -#if defined(HAS_PASSWD) && defined(HAS_ENDPWENT) - dVAR; dSP; - endpwent(); - RETPUSHYES; -#else - DIE(aTHX_ PL_no_func, "endpwent"); -#endif -} - PP(pp_ggrent) { #ifdef HAS_GROUP @@ -5386,28 +5392,6 @@ PP(pp_ggrent) #endif } -PP(pp_sgrent) -{ -#if defined(HAS_GROUP) && defined(HAS_SETGRENT) - dVAR; dSP; - setgrent(); - RETPUSHYES; -#else - DIE(aTHX_ PL_no_func, "setgrent"); -#endif -} - -PP(pp_egrent) -{ -#if defined(HAS_GROUP) && defined(HAS_ENDGRENT) - dVAR; dSP; - endgrent(); - RETPUSHYES; -#else - DIE(aTHX_ PL_no_func, "endgrent"); -#endif -} - PP(pp_getlogin) { #ifdef HAS_GETLOGIN |