mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-18 09:32:40 -05:00
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
This commit is contained in:
parent
1bdb3cd8a9
commit
a1f7fd85ad
1 changed files with 4 additions and 1 deletions
|
|
@ -36,6 +36,7 @@
|
||||||
#include <usb.h>
|
#include <usb.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <pwd.h>
|
||||||
#endif
|
#endif
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
#include <mntent.h>
|
#include <mntent.h>
|
||||||
|
|
@ -192,7 +193,9 @@ QString getUserName(void)
|
||||||
return QString::fromWCharArray(userbuf);
|
return QString::fromWCharArray(userbuf);
|
||||||
#endif
|
#endif
|
||||||
#if defined(Q_OS_LINUX) || defined(Q_OS_MACX)
|
#if defined(Q_OS_LINUX) || defined(Q_OS_MACX)
|
||||||
return QString(getlogin());
|
struct passwd *user;
|
||||||
|
user = getpwuid(geteuid());
|
||||||
|
return QString(user->pw_name);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue