diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2008-06-21 11:40:04 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2008-06-21 11:40:04 +0000 |
commit | a1f7fd85ad7cb557e73621174507e5d7d35ebd23 (patch) | |
tree | b19e0c48cc93770547ee56c8e153d4464b59a635 /rbutil/rbutilqt/utils.cpp | |
parent | 1bdb3cd8a9a281c1f694e3a81248abffe955fed6 (diff) | |
download | rockbox-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
Diffstat (limited to 'rbutil/rbutilqt/utils.cpp')
-rw-r--r-- | rbutil/rbutilqt/utils.cpp | 5 |
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 @@ | |||
36 | #include <usb.h> | 36 | #include <usb.h> |
37 | #include <sys/utsname.h> | 37 | #include <sys/utsname.h> |
38 | #include <unistd.h> | 38 | #include <unistd.h> |
39 | #include <pwd.h> | ||
39 | #endif | 40 | #endif |
40 | #if defined(Q_OS_LINUX) | 41 | #if defined(Q_OS_LINUX) |
41 | #include <mntent.h> | 42 | #include <mntent.h> |
@@ -192,7 +193,9 @@ QString getUserName(void) | |||
192 | return QString::fromWCharArray(userbuf); | 193 | return QString::fromWCharArray(userbuf); |
193 | #endif | 194 | #endif |
194 | #if defined(Q_OS_LINUX) || defined(Q_OS_MACX) | 195 | #if defined(Q_OS_LINUX) || defined(Q_OS_MACX) |
195 | return QString(getlogin()); | 196 | struct passwd *user; |
197 | user = getpwuid(geteuid()); | ||
198 | return QString(user->pw_name); | ||
196 | #endif | 199 | #endif |
197 | } | 200 | } |
198 | 201 | ||