Need to add some more conditions to deal with the case
Norton T. Allen [Wed, 28 Jul 1999 13:08:42 +0000 (09:08 -0400)]
  defined(HAS_GETSPNAM) && ! defined(HAS_GETSPENT)
which is true for QNX4.
To: perl5-porters@perl.org
Subject: [ID 19990728.009] Patch:pp_sys.c _58 QNX
Message-Id: <199907281708.NAA07947@bottesini.harvard.edu>

p4raw-id: //depot/cfgperl@3817

pp_sys.c

index a849dbb..5b421db 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4617,7 +4617,7 @@ PP(pp_gpwent)
     register SV *sv;
     struct passwd *pwent;
     STRLEN n_a;
-#ifdef HAS_GETSPENT
+#if defined(HAS_GETSPENT) || defined(HAS_GETSPNAM)
     struct spwd *spwent = NULL;
 #endif
 
@@ -4639,8 +4639,10 @@ PP(pp_gpwent)
            spwent = getspnam(pwent->pw_name);
     }
 #  endif
+#  ifdef HAS_GETSPENT
     else
        spwent = (struct spwd *)getspent();
+#  endif
 #endif
 
     EXTEND(SP, 10);
@@ -4661,7 +4663,7 @@ PP(pp_gpwent)
 
        PUSHs(sv = sv_mortalcopy(&PL_sv_no));
 #ifdef PWPASSWD
-#   ifdef HAS_GETSPENT
+#   if defined(HAS_GETSPENT) || defined(HAS_GETSPNAM)
       if (spwent)
               sv_setpv(sv, spwent->sp_pwdp);
       else