nis_maplist(): Use check of yp_get_default_domain() return value

that's used in other parts of this module.

nis_maps(): use PyArg_NoArgs().
This commit is contained in:
Barry Warsaw 1996-12-11 00:29:14 +00:00
parent adbf4e66df
commit 3696c524a4
1 changed files with 5 additions and 1 deletions

View File

@ -295,7 +295,9 @@ nis_maplist ()
char *server = ""; char *server = "";
int mapi = 0; int mapi = 0;
yp_get_default_domain (&dom); if ((err = yp_get_default_domain (&dom)) != 0)
return nis_error(err);
while (!strcmp("", server) && aliases[mapi].map != 0L) { while (!strcmp("", server) && aliases[mapi].map != 0L) {
yp_master (dom, aliases[mapi].map, &server); yp_master (dom, aliases[mapi].map, &server);
mapi++; mapi++;
@ -325,6 +327,8 @@ nis_maps (self, args)
nismaplist *maps; nismaplist *maps;
PyObject *list; PyObject *list;
if (!PyArg_NoArgs(args))
return NULL;
if ((maps = nis_maplist ()) == NULL) if ((maps = nis_maplist ()) == NULL)
return NULL; return NULL;
if ((list = PyList_New(0)) == NULL) if ((list = PyList_New(0)) == NULL)