nss_winbind: Use #ifdef instead of #if for config.h definitions
authorAndreas Schneider <asn@samba.org>
Tue, 20 Nov 2018 13:08:31 +0000 (14:08 +0100)
committerGary Lockyer <gary@samba.org>
Wed, 28 Nov 2018 22:19:22 +0000 (23:19 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
nsswitch/winbind_nss_linux.c

index c7443e5..4ab10b9 100644 (file)
 
 #include "winbind_client.h"
 
-#if HAVE_PTHREAD_H
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
 static pthread_mutex_t winbind_nss_mutex = PTHREAD_MUTEX_INITIALIZER;
 #endif
 
@@ -243,11 +243,11 @@ static NSS_STATUS fill_pwent(struct passwd *result,
        /* The struct passwd for Solaris has some extra fields which must
           be initialised or nscd crashes. */
 
-#if HAVE_PASSWD_PW_COMMENT
+#ifdef HAVE_PASSWD_PW_COMMENT
        result->pw_comment = "";
 #endif
 
-#if HAVE_PASSWD_PW_AGE
+#ifdef HAVE_PASSWD_PW_AGE
        result->pw_age = "";
 #endif
 
@@ -369,7 +369,7 @@ _nss_winbind_setpwent(void)
        fprintf(stderr, "[%5d]: setpwent\n", getpid());
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_lock(&winbind_nss_mutex);
 #endif
 
@@ -385,7 +385,7 @@ _nss_winbind_setpwent(void)
                nss_err_str(ret), ret);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_unlock(&winbind_nss_mutex);
 #endif
        return ret;
@@ -401,7 +401,7 @@ _nss_winbind_endpwent(void)
        fprintf(stderr, "[%5d]: endpwent\n", getpid());
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_lock(&winbind_nss_mutex);
 #endif
 
@@ -417,7 +417,7 @@ _nss_winbind_endpwent(void)
                nss_err_str(ret), ret);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_unlock(&winbind_nss_mutex);
 #endif
 
@@ -438,7 +438,7 @@ _nss_winbind_getpwent_r(struct passwd *result, char *buffer,
        fprintf(stderr, "[%5d]: getpwent\n", getpid());
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_lock(&winbind_nss_mutex);
 #endif
 
@@ -514,7 +514,7 @@ _nss_winbind_getpwent_r(struct passwd *result, char *buffer,
                nss_err_str(ret), ret);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_unlock(&winbind_nss_mutex);
 #endif
        return ret;
@@ -535,7 +535,7 @@ _nss_winbind_getpwuid_r(uid_t uid, struct passwd *result, char *buffer,
        fprintf(stderr, "[%5d]: getpwuid_r %d\n", getpid(), (unsigned int)uid);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_lock(&winbind_nss_mutex);
 #endif
 
@@ -587,7 +587,7 @@ _nss_winbind_getpwuid_r(uid_t uid, struct passwd *result, char *buffer,
                (unsigned int)uid, nss_err_str(ret), ret);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_unlock(&winbind_nss_mutex);
 #endif
 
@@ -608,7 +608,7 @@ _nss_winbind_getpwnam_r(const char *name, struct passwd *result, char *buffer,
        fprintf(stderr, "[%5d]: getpwnam_r %s\n", getpid(), name);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_lock(&winbind_nss_mutex);
 #endif
 
@@ -663,7 +663,7 @@ _nss_winbind_getpwnam_r(const char *name, struct passwd *result, char *buffer,
                name, nss_err_str(ret), ret);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_unlock(&winbind_nss_mutex);
 #endif
 
@@ -689,7 +689,7 @@ _nss_winbind_setgrent(void)
        fprintf(stderr, "[%5d]: setgrent\n", getpid());
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_lock(&winbind_nss_mutex);
 #endif
 
@@ -705,7 +705,7 @@ _nss_winbind_setgrent(void)
                nss_err_str(ret), ret);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_unlock(&winbind_nss_mutex);
 #endif
 
@@ -722,7 +722,7 @@ _nss_winbind_endgrent(void)
        fprintf(stderr, "[%5d]: endgrent\n", getpid());
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_lock(&winbind_nss_mutex);
 #endif
 
@@ -738,7 +738,7 @@ _nss_winbind_endgrent(void)
                nss_err_str(ret), ret);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_unlock(&winbind_nss_mutex);
 #endif
 
@@ -761,7 +761,7 @@ winbind_getgrent(enum winbindd_cmd cmd,
        fprintf(stderr, "[%5d]: getgrent\n", getpid());
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_lock(&winbind_nss_mutex);
 #endif
 
@@ -846,7 +846,7 @@ winbind_getgrent(enum winbindd_cmd cmd,
                nss_err_str(ret), ret);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_unlock(&winbind_nss_mutex);
 #endif
 
@@ -884,7 +884,7 @@ _nss_winbind_getgrnam_r(const char *name,
        fprintf(stderr, "[%5d]: getgrnam %s\n", getpid(), name);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_lock(&winbind_nss_mutex);
 #endif
 
@@ -944,7 +944,7 @@ _nss_winbind_getgrnam_r(const char *name,
                name, nss_err_str(ret), ret);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_unlock(&winbind_nss_mutex);
 #endif
 
@@ -967,7 +967,7 @@ _nss_winbind_getgrgid_r(gid_t gid,
        fprintf(stderr, "[%5d]: getgrgid %d\n", getpid(), gid);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_lock(&winbind_nss_mutex);
 #endif
 
@@ -1025,7 +1025,7 @@ _nss_winbind_getgrgid_r(gid_t gid,
                (unsigned int)gid, nss_err_str(ret), ret);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_unlock(&winbind_nss_mutex);
 #endif
        return ret;
@@ -1048,7 +1048,7 @@ _nss_winbind_initgroups_dyn(const char *user, gid_t group, long int *start,
                user, group);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_lock(&winbind_nss_mutex);
 #endif
 
@@ -1140,7 +1140,7 @@ _nss_winbind_initgroups_dyn(const char *user, gid_t group, long int *start,
                user, nss_err_str(ret), ret);
 #endif
 
-#if HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
        pthread_mutex_unlock(&winbind_nss_mutex);
 #endif