Whamcloud - gitweb
e2fsck: add portability fallback in case getpwuid_r is not present
[tools/e2fsprogs.git] / e2fsck / logfile.c
index 76ae52d..3bb15cd 100644 (file)
@@ -126,7 +126,11 @@ static void expand_percent_expression(e2fsck_t ctx, char ch,
                strcpy(buf, "tytso");
                break;
 #else
+#ifdef HAVE_GETPWUID_R
                getpwuid_r(getuid(), &pw_struct, buf, sizeof(buf), &pw);
+#else
+               pw = getpwuid(getuid());
+#endif
                if (pw)
                        append_string(s, pw->pw_name, 0);
                return;