From a1f7fd85ad7cb557e73621174507e5d7d35ebd23 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sat, 21 Jun 2008 11:40:04 +0000 Subject: use getpwuid() instead of getlogin() on linux as the latter doesn't seem to work in all cases. Thanks to BigBambi for reporting. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17740 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/rbutilqt/utils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'rbutil') diff --git a/rbutil/rbutilqt/utils.cpp b/rbutil/rbutilqt/utils.cpp index 59494cd74e..5aa5cd4a55 100644 --- a/rbutil/rbutilqt/utils.cpp +++ b/rbutil/rbutilqt/utils.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #endif #if defined(Q_OS_LINUX) #include @@ -192,7 +193,9 @@ QString getUserName(void) return QString::fromWCharArray(userbuf); #endif #if defined(Q_OS_LINUX) || defined(Q_OS_MACX) - return QString(getlogin()); + struct passwd *user; + user = getpwuid(geteuid()); + return QString(user->pw_name); #endif } -- cgit v1.2.3