Fix compilation warning/error (#74)

Fix `comparison between signed and unsigned integer expressions` problem.
User ID is a positive integer  in Linux/UNIX(macOS, FreeBSD, Solaris), also `geteuid()` never fails with return code.
This commit is contained in:
iakov 2019-10-10 14:47:25 +03:00 committed by Itay Grudev
parent e18babe559
commit 196bb34af6

View File

@ -118,11 +118,9 @@ void SingleApplicationPrivate::genBlockServerName()
#ifdef Q_OS_UNIX
QByteArray username;
uid_t uid = geteuid();
if( uid != -1 ) {
struct passwd *pw = getpwuid(uid);
if( pw ) {
username = pw->pw_name;
}
struct passwd *pw = getpwuid(uid);
if( pw ) {
username = pw->pw_name;
}
if( username.isEmpty() ) {
username = qgetenv("USER");