]> err.no Git - util-linux/commitdiff
libmount: _SC_GETPW_R_SIZE_MAX portability issue
authorKarel Zak <kzak@redhat.com>
Sun, 23 Jan 2011 21:37:22 +0000 (22:37 +0100)
committerKarel Zak <kzak@redhat.com>
Sun, 23 Jan 2011 21:37:22 +0000 (22:37 +0100)
Addresses: https://bugs.gentoo.org/show_bug.cgi?id=350340
Reported-by: Alan Hourihane <alanh@fairlite.co.uk>
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/mount/src/utils.c

index c9e171cc9f824b4de2d6dac2a48767a77f4c79c8..35d43452e72995493101035632b3b3c5cd63b36f 100644 (file)
@@ -372,7 +372,11 @@ char *mnt_get_username(const uid_t uid)
 {
         struct passwd pwd;
        struct passwd *res;
+#ifdef _SC_GETPW_R_SIZE_MAX
        size_t sz = sysconf(_SC_GETPW_R_SIZE_MAX);
+#else
+       size_t sz = 0;
+#endif
        char *buf, *username = NULL;
 
        if (sz <= 0)