reentr.c: Handle systems without getpwent
authorBrian Fraser <fraserbn@gmail.com>
Wed, 22 Jan 2014 13:17:53 +0000 (10:17 -0300)
committerBrian Fraser <fraserbn@gmail.com>
Sun, 26 Jan 2014 17:44:25 +0000 (14:44 -0300)
Namely, Android.

reentr.c
regen/reentr.pl

index a5ea192..917807c 100644 (file)
--- a/reentr.c
+++ b/reentr.c
@@ -431,8 +431,10 @@ Perl_reentrant_retry(const char *f, ...)
                    uid = va_arg(ap, Uid_t);
 #endif
                    retptr = getpwuid(uid); break;
+#if defined(HAS_GETPWENT) || defined(HAS_GETPWENT_R)
                case OP_GPWENT:
                    retptr = getpwent(); break;
+#endif
                default:
                    SETERRNO(ERANGE, LIB_INVARG);
                    break;
index 6dac299..e4cbde3 100644 (file)
@@ -945,8 +945,10 @@ Perl_reentrant_retry(const char *f, ...)
                    uid = va_arg(ap, Uid_t);
 #endif
                    retptr = getpwuid(uid); break;
+#if defined(HAS_GETPWENT) || defined(HAS_GETPWENT_R)
                case OP_GPWENT:
                    retptr = getpwent(); break;
+#endif
                default:
                    SETERRNO(ERANGE, LIB_INVARG);
                    break;