if (db == NULL) { err = __nss_db_open (DBFILE, DB_BTREE, O_RDONLY, 0, NULL, NULL, &db);  if (err != 0) { __set_errno (err); status = err == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL; } else {  int fd; int result;  err = db->fd (db, &fd); if (err != 0) { __set_errno (err); result = -1; } else { result = fcntl (fd, F_GETFD, 0);  if (result >= 0) result = fcntl (fd, F_SETFD, result | FD_CLOEXEC); }  if (result < 0) {  db->close (db, 0); db = NULL; status = NSS_STATUS_UNAVAIL; } } }
status = internal_setent (DBFILE, &db);
_nss_db_setnetgrent (const char *group){  enum nss_status status = NSS_STATUS_SUCCESS;  int err;  __libc_lock_lock (lock);  /* Make sure the data base file is open.  */  if (db == NULL)    {      err = __nss_db_open (DBFILE, DB_BTREE, O_RDONLY, 0, NULL, NULL, &db);      if (err != 0)	{	  __set_errno (err);	  status = err == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;	}      else	{	  /* We have to make sure the file is  `closed on exec'.  */	  int fd;	  int result;	  err = db->fd (db, &fd);	  if (err != 0)	    {	      __set_errno (err);	      result = -1;	    }	  else	    {	      result = fcntl (fd, F_GETFD, 0);	      if (result >= 0)		result = fcntl (fd, F_SETFD, result | FD_CLOEXEC);	    }	  if (result < 0)	    {	      /* Something went wrong.  Close the stream and return a		 failure.  */	      db->close (db, 0);	      db = NULL;	      status = NSS_STATUS_UNAVAIL;	    }	}    }  if (status == NSS_STATUS_SUCCESS)    {      DBT key = { data: (void *) group, size: strlen (group), flags: 0 };      DBT value;      value.flags = 0;      if (db->get (db, NULL, &key, &value, 0) != 0)	status = NSS_STATUS_NOTFOUND;      else	cursor = entry = value.data;    }  __libc_lock_unlock (lock);  return status;}