summaryrefslogtreecommitdiffstats
path: root/Modules/nismodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/nismodule.c')
-rw-r--r--Modules/nismodule.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/Modules/nismodule.c b/Modules/nismodule.c
index 5db26f4..00c3561 100644
--- a/Modules/nismodule.c
+++ b/Modules/nismodule.c
@@ -57,6 +57,8 @@ nis_mapname (map)
return map;
}
+typedef int (*foreachfunc) PROTO((int, char *, int, char *, int, char *));
+
static int
nis_foreach (instatus, inkey, inkeylen, inval, invallen, indata)
int instatus;
@@ -134,7 +136,7 @@ nis_cat (self, args)
cat = newdictobject ();
if (cat == NULL)
return NULL;
- cb.foreach = nis_foreach;
+ cb.foreach = (foreachfunc)nis_foreach;
cb.data = (char *)cat;
BGN_SAVE
map = nis_mapname (map);
@@ -147,9 +149,17 @@ nis_cat (self, args)
return cat;
}
-#define YPPROC_MAPLIST ((u_long)11)
-#define YPPROG ((u_long)100004)
-#define YPVERS ((u_long)2)
+/* These should be u_long on Sun h/w but not on 64-bit h/w.
+ This is not portable to machines with 16-bit ints and no prototypes */
+#ifndef YPPROC_MAPLIST
+#define YPPROC_MAPLIST 11
+#endif
+#ifndef YPPROG
+#define YPPROG 100004
+#endif
+#ifndef YPVERS
+#define YPVERS 2
+#endif
typedef char *domainname;
typedef char *mapname;
@@ -260,8 +270,9 @@ nisproc_maplist_2(argp, clnt)
static nisresp_maplist res;
memset(&res, 0, sizeof(res));
- if (clnt_call(clnt, YPPROC_MAPLIST, nis_xdr_domainname, argp, nis_xdr_ypresp_maplist
-, &res, TIMEOUT) != RPC_SUCCESS) {
+ if (clnt_call(clnt, YPPROC_MAPLIST, nis_xdr_domainname, (caddr_t)argp,
+ nis_xdr_ypresp_maplist, (caddr_t)&res, TIMEOUT)
+ != RPC_SUCCESS) {
return (NULL);
}
return (&res);