Fix comparison between signed/unsigned

This commit is contained in:
Jonas Kvinge
2019-11-15 00:23:06 +01:00
parent bbad45f1e7
commit 1b65dcd7df
11 changed files with 19 additions and 25 deletions

View File

@@ -114,12 +114,9 @@ void SingleCoreApplicationPrivate::genBlockServerName() {
#ifdef Q_OS_UNIX
QByteArray username;
#if defined(HAVE_GETEUID) && defined(HAVE_GETPWUID)
uid_t uid = geteuid();
if (uid != -1) {
struct passwd *pw = getpwuid(uid);
if (pw) {
username = pw->pw_name;
}
struct passwd *pw = getpwuid(geteuid());
if (pw) {
username = pw->pw_name;
}
#endif
if (username.isEmpty()) username = qgetenv("USER");