This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Uid_t and Gid_t can easily be shorts and one cannot
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 11 Mar 2003 17:43:10 +0000 (17:43 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 11 Mar 2003 17:43:10 +0000 (17:43 +0000)
pull shorts off the va_args, int is the shortest (ahem).

p4raw-id: //depot/perl@18919

reentr.c
reentr.pl

index 8b655da..8dddbe7 100644 (file)
--- a/reentr.c
+++ b/reentr.c
@@ -368,7 +368,11 @@ Perl_reentrant_retry(const char *f, ...)
                    p0 = va_arg(ap, void *);
                    retptr = getgrnam(p0); break;
                case OP_GGRGID:
+#if Gid_t_size < INTSIZE
+                   gid = (Gid_t)va_arg(ap, int);
+#else
                    gid = va_arg(ap, Gid_t);
+#endif
                    retptr = getgrgid(gid); break;
                case OP_GGRENT:
                    retptr = getgrent(); break;
@@ -431,7 +435,11 @@ Perl_reentrant_retry(const char *f, ...)
                    p0 = va_arg(ap, void *);
                    retptr = getpwnam(p0); break;
                case OP_GPWUID:
+#if Uid_t_size < INTSIZE
+                   uid = (Uid_t)va_arg(ap, int);
+#else
                    uid = va_arg(ap, Uid_t);
+#endif
                    retptr = getpwuid(uid); break;
                case OP_GPWENT:
                    retptr = getpwent(); break;
index ee94c8d..4f9619e 100644 (file)
--- a/reentr.pl
+++ b/reentr.pl
@@ -851,7 +851,11 @@ Perl_reentrant_retry(const char *f, ...)
                    p0 = va_arg(ap, void *);
                    retptr = getgrnam(p0); break;
                case OP_GGRGID:
+#if Gid_t_size < INTSIZE
+                   gid = (Gid_t)va_arg(ap, int);
+#else
                    gid = va_arg(ap, Gid_t);
+#endif
                    retptr = getgrgid(gid); break;
                case OP_GGRENT:
                    retptr = getgrent(); break;
@@ -914,7 +918,11 @@ Perl_reentrant_retry(const char *f, ...)
                    p0 = va_arg(ap, void *);
                    retptr = getpwnam(p0); break;
                case OP_GPWUID:
+#if Uid_t_size < INTSIZE
+                   uid = (Uid_t)va_arg(ap, int);
+#else
                    uid = va_arg(ap, Uid_t);
+#endif
                    retptr = getpwuid(uid); break;
                case OP_GPWENT:
                    retptr = getpwent(); break;