summaryrefslogtreecommitdiff
path: root/src/xwayland/Server.cpp
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2025-06-04 16:54:12 +0200
committervaxerski <vaxry@vaxry.net>2025-06-04 16:54:12 +0200
commitd9f7448d82132f4c1c07105f4bc3a4f717915d30 (patch)
tree7b7c710367bcd9043e0b5a8c5b2243712886942f /src/xwayland/Server.cpp
parentb5c0d0b8aa8bb095ac447bf6c73486cb1c172b6e (diff)
xwayland: pad pid with leading zeroes in lockfile
fixes #10652
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;
}