This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

A patch for nss/getXXent_r.c


setup in nss/getXXent_r.c has the return type of enum nss_status:

/* Possible results of lookup using a nss_* function.  */
enum nss_status
{
  NSS_STATUS_TRYAGAIN = -2,
  NSS_STATUS_UNAVAIL,
  NSS_STATUS_NOTFOUND,
  NSS_STATUS_SUCCESS,
  NSS_STATUS_RETURN
};

It is wrong since setup returns zero if a service is found and nonzero
if there are no services. nss_status is misleading. This patch changes
it to int.


-- 
H.J. Lu (hjl@valinux.com)
---
2000-12-05  H.J. Lu  <hjl@gnu.org>

	* nss/getXXent_r.c (setup): Change the return type to int.

Index: nss/getXXent_r.c
===================================================================
RCS file: /work/cvs/gnu/glibc/nss/getXXent_r.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 getXXent_r.c
--- nss/getXXent_r.c	2000/12/04 18:36:01	1.1.1.3
+++ nss/getXXent_r.c	2000/12/05 18:14:30
@@ -123,7 +123,7 @@ extern int DB_LOOKUP_FCT (service_user *
 /* Set up NIP to run through the services.  If ALL is zero, use NIP's
    current location if it's not nil.  Return nonzero if there are no
    services (left).  */
-static enum nss_status
+static int
 setup (void **fctp, const char *func_name, int all)
 {
   int no_more;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]