summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt')
-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 @@
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