David M. Syzdek [Fri, 6 Mar 2009 23:03:40 +0000 (14:03 -0900)]
The gr_gid member of struct group is being cast as an int even if
system uses an unsigned int. This patch tests for the use of an
unsigned int for the gr_gid member and casts the value as appropiate.
Created with Arthur Corliss <corliss@corliss@digitalmages.com>.
Signed-off-by: David M. Syzdek <david@syzdek.net>
PUSHs(sv);
if (grent) {
if (which == OP_GGRNAM)
+#if Gid_t_sign <= 0
sv_setiv(sv, (IV)grent->gr_gid);
+#else
+ sv_setuv(sv, (UV)grent->gr_gid);
+#endif
else
sv_setpv(sv, grent->gr_name);
}
PUSHs(sv_mortalcopy(&PL_sv_no));
#endif
+#if Gid_t_sign <= 0
mPUSHi(grent->gr_gid);
+#else
+ mPUSHu(grent->gr_gid);
+#endif
#if !(defined(_CRAYMPP) && defined(USE_REENTRANT_API))
/* In UNICOS/mk (_CRAYMPP) the multithreading