Whamcloud - gitweb
Merge branch 'maint' into next
[tools/e2fsprogs.git] / e2fsck / logfile.c
index 76ae52d..9229fbf 100644 (file)
@@ -13,6 +13,9 @@
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 
 #include "e2fsck.h"
 #include <pwd.h>
@@ -126,7 +129,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;