summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-06-02 01:37:33 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-06-02 01:37:33 +0000
commit69dec784b2576ea54ab7c7c5e03371f1f8861260 (patch)
treef9c5605e00df11c9c976f39346dfc612c191dab6 /pp_sys.c
parentba106d47906768b6e657462b9a484fe0c3a0f0d5 (diff)
parentf54b75aca7a5c24d01f65ce2849ffe277974f0e9 (diff)
downloadperl-69dec784b2576ea54ab7c7c5e03371f1f8861260.tar.gz
integrate cfgperl contents into mainline
p4raw-id: //depot/perl@3516
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/pp_sys.c b/pp_sys.c
index c5344dfdea..bc5ccc063e 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -17,8 +17,10 @@
#include "EXTERN.h"
#include "perl.h"
-#ifdef HAS_GETSPENT
-/* Shadow password support for solaris - pdo@cs.umd.edu*/
+#ifdef I_SHADOW
+/* Shadow password support for solaris - pdo@cs.umd.edu
+ * Not just Solaris: at least HP-UX, IRIX, Linux.
+ * the API is from SysV. --jhi */
#include <shadow.h>
#endif
@@ -4564,11 +4566,13 @@ PP(pp_gpwent)
else
pwent = (struct passwd *)getpwent();
-#ifdef HAS_GETSPENT
+#ifdef HAS_GETSPNAM
if (which == OP_GPWNAM)
spwent = getspnam(pwent->pw_name);
+# ifdef HAS_GETSPUID /* AFAIK there isn't any anywhere. --jhi */
else if (which == OP_GPWUID)
spwent = getspnam(pwent->pw_name);
+# endif
else
spwent = (struct spwd *)getspent();
#endif
@@ -4591,14 +4595,14 @@ PP(pp_gpwent)
PUSHs(sv = sv_mortalcopy(&PL_sv_no));
#ifdef PWPASSWD
-#ifdef HAS_GETSPENT
+# ifdef HAS_GETSPENT
if (spwent)
sv_setpv(sv, spwent->sp_pwdp);
else
sv_setpv(sv, pwent->pw_passwd);
-#else
+# else
sv_setpv(sv, pwent->pw_passwd);
-#endif
+# endif
#endif
PUSHs(sv = sv_mortalcopy(&PL_sv_no));
@@ -4662,9 +4666,9 @@ PP(pp_spwent)
djSP;
#if defined(HAS_PASSWD) && defined(HAS_SETPWENT) && !defined(CYGWIN32)
setpwent();
-#ifdef HAS_GETSPENT
+# ifdef HAS_SETSPENT
setspent();
-#endif
+# endif
RETPUSHYES;
#else
DIE(PL_no_func, "setpwent");
@@ -4676,9 +4680,9 @@ PP(pp_epwent)
djSP;
#if defined(HAS_PASSWD) && defined(HAS_ENDPWENT)
endpwent();
-#ifdef HAS_GETSPENT
+# ifdef HAS_ENDSPENT
endspent();
-#endif
+# endif
RETPUSHYES;
#else
DIE(PL_no_func, "endpwent");