summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2008-06-21 11:40:04 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2008-06-21 11:40:04 +0000
commita1f7fd85ad7cb557e73621174507e5d7d35ebd23 (patch)
treeb19e0c48cc93770547ee56c8e153d4464b59a635
parent1bdb3cd8a9a281c1f694e3a81248abffe955fed6 (diff)
downloadrockbox-a1f7fd85ad7cb557e73621174507e5d7d35ebd23.tar.gz
rockbox-a1f7fd85ad7cb557e73621174507e5d7d35ebd23.zip
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
-rw-r--r--rbutil/rbutilqt/utils.cpp5
1 files changed, 4 insertions, 1 deletions
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 <usb.h>
#include <sys/utsname.h>
#include <unistd.h>
+#include <pwd.h>
#endif
#if defined(Q_OS_LINUX)
#include <mntent.h>
@@ -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
}