Print this page
7126 NSS_XbyY_FINI has too much logic for a function-like macro


1007  */
1008 static uint_t *
1009 _nss_status_vec_p()
1010 {
1011         return (tsdalloc(_T_NSS_STATUS_VEC, sizeof (uint_t), NULL));
1012 }
1013 
1014 unsigned int
1015 _nss_status_vec(void)
1016 {
1017         unsigned int *status_vec_p = _nss_status_vec_p();
1018 
1019         return ((status_vec_p != NULL) ? *status_vec_p : (1 << NSS_UNAVAIL));
1020 }
1021 
1022 static void
1023 output_loop_diag_a(
1024         int n,
1025         char *dbase,
1026         struct __nsw_lookup_v1 *lkp)
1027 
1028 {
1029         (void) fprintf(__nss_debug_file,
1030                 "NSS_retry(%d): '%s': trying '%s' ... ",
1031                 n, dbase, lkp->service_name);
1032         (void) fflush(__nss_debug_file);
1033 
1034 }
1035 
1036 static void
1037 output_loop_diag_b(
1038         nss_status_t res,
1039         struct __nsw_lookup_v1 *lkp)
1040 
1041 {
1042         (void) fprintf(__nss_debug_file, "result=");
1043         switch (res) {
1044         case NSS_SUCCESS:
1045                 (void) fprintf(__nss_debug_file, "SUCCESS");
1046                 break;
1047         case NSS_NOTFOUND:
1048                 (void) fprintf(__nss_debug_file, "NOTFOUND");
1049                 break;
1050         case NSS_UNAVAIL:
1051                 (void) fprintf(__nss_debug_file, "UNAVAIL");
1052                 break;
1053         case NSS_TRYAGAIN:
1054                 (void) fprintf(__nss_debug_file, "TRYAGAIN");
1055                 break;
1056         case NSS_NISSERVDNS_TRYAGAIN:
1057                 (void) fprintf(__nss_debug_file, "NISSERVDNS_TRYAGAIN");
1058                 break;
1059         default:
1060                 (void) fprintf(__nss_debug_file, "undefined");


2281 
2282         /* clear cookie */
2283         contextp->cookie = NSCD_NEW_COOKIE;
2284         return (NSS_SUCCESS);
2285 }
2286 
2287 /*
2288  * Internal private API to return default suggested buffer sizes
2289  * for nsswitch API requests.
2290  */
2291 
2292 size_t
2293 _nss_get_bufsizes(int arg)
2294 {
2295         switch (arg) {
2296         case _SC_GETGR_R_SIZE_MAX:
2297                 return (__nss_buflen_group);
2298         }
2299         return (__nss_buflen_default);
2300 }










1007  */
1008 static uint_t *
1009 _nss_status_vec_p()
1010 {
1011         return (tsdalloc(_T_NSS_STATUS_VEC, sizeof (uint_t), NULL));
1012 }
1013 
1014 unsigned int
1015 _nss_status_vec(void)
1016 {
1017         unsigned int *status_vec_p = _nss_status_vec_p();
1018 
1019         return ((status_vec_p != NULL) ? *status_vec_p : (1 << NSS_UNAVAIL));
1020 }
1021 
1022 static void
1023 output_loop_diag_a(
1024         int n,
1025         char *dbase,
1026         struct __nsw_lookup_v1 *lkp)

1027 {
1028         (void) fprintf(__nss_debug_file,
1029             "NSS_retry(%d): '%s': trying '%s' ... ",
1030             n, dbase, lkp->service_name);
1031         (void) fflush(__nss_debug_file);
1032 
1033 }
1034 
1035 static void
1036 output_loop_diag_b(
1037         nss_status_t res,
1038         struct __nsw_lookup_v1 *lkp)

1039 {
1040         (void) fprintf(__nss_debug_file, "result=");
1041         switch (res) {
1042         case NSS_SUCCESS:
1043                 (void) fprintf(__nss_debug_file, "SUCCESS");
1044                 break;
1045         case NSS_NOTFOUND:
1046                 (void) fprintf(__nss_debug_file, "NOTFOUND");
1047                 break;
1048         case NSS_UNAVAIL:
1049                 (void) fprintf(__nss_debug_file, "UNAVAIL");
1050                 break;
1051         case NSS_TRYAGAIN:
1052                 (void) fprintf(__nss_debug_file, "TRYAGAIN");
1053                 break;
1054         case NSS_NISSERVDNS_TRYAGAIN:
1055                 (void) fprintf(__nss_debug_file, "NISSERVDNS_TRYAGAIN");
1056                 break;
1057         default:
1058                 (void) fprintf(__nss_debug_file, "undefined");


2279 
2280         /* clear cookie */
2281         contextp->cookie = NSCD_NEW_COOKIE;
2282         return (NSS_SUCCESS);
2283 }
2284 
2285 /*
2286  * Internal private API to return default suggested buffer sizes
2287  * for nsswitch API requests.
2288  */
2289 
2290 size_t
2291 _nss_get_bufsizes(int arg)
2292 {
2293         switch (arg) {
2294         case _SC_GETGR_R_SIZE_MAX:
2295                 return (__nss_buflen_group);
2296         }
2297         return (__nss_buflen_default);
2298 }
2299 
2300 void *
2301 _nss_XbyY_fini(nss_XbyY_args_t *args)
2302 {
2303         if ((args->returnval == NULL) && (args->erange != 0))
2304                 errno = ERANGE;
2305         return (args->returnval);
2306 }