summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/utils.cpp')
-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
}