summaryrefslogtreecommitdiff
path: root/src/xwayland/Server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xwayland/Server.cpp')
-rw-r--r--src/xwayland/Server.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/xwayland/Server.cpp b/src/xwayland/Server.cpp
index 814bd20c..0cc16fef 100644
--- a/src/xwayland/Server.cpp
+++ b/src/xwayland/Server.cpp
@@ -199,8 +199,9 @@ bool CXWaylandServer::tryOpenSockets() {
continue;
}
- const std::string pidStr = std::to_string(getpid());
- if (write(fd.get(), pidStr.c_str(), pidStr.length()) != (long)pidStr.length()) {
+ const std::string pidStr = std::format("{:010d}\n", getpid());
+ ASSERT(pidStr.length() == 11);
+ if (write(fd.get(), pidStr.c_str(), 11) != 11L) {
safeRemove(lockPath);
continue;
}