mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
Match socket length check with Qt
This commit is contained in:
parent
cbe7b5f61b
commit
6fd02ccbae
1 changed files with 2 additions and 1 deletions
|
@ -50,6 +50,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/un.h>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
@ -384,7 +385,7 @@ QString SingleInstanceLocalServerName(const QString &hash) {
|
||||||
+ '-'
|
+ '-'
|
||||||
+ cGUIDStr();
|
+ cGUIDStr();
|
||||||
|
|
||||||
if (idealSocketPath.size() >= 108) {
|
if ((idealSocketPath.size() + 1) >= sizeof(sockaddr_un().sun_path)) {
|
||||||
return AppRuntimeDirectory() + hash;
|
return AppRuntimeDirectory() + hash;
|
||||||
} else {
|
} else {
|
||||||
return idealSocketPath;
|
return idealSocketPath;
|
||||||
|
|
Loading…
Add table
Reference in a new issue