83 {
84 if (!bindAddress.getSunPath().empty() && !bindAddress.getSunPath().starts_with('\0')) {
85 if ((
lockFd =
open(bindAddress.getSunPath().append(
".lock").data(), O_RDONLY | O_CREAT, 0600)) >= 0) {
86 LOG(DEBUG) << "Opening lock file: " << bindAddress.getSunPath().append(".lock").data();
88 LOG(DEBUG) << "Locking lock file: " << bindAddress.getSunPath().append(".lock").data();
89 if (std::filesystem::exists(bindAddress.getSunPath().data())) {
90 if (std::remove(bindAddress.getSunPath().data()) == 0) {
91 LOG(WARNING) << "Removed stalled sun_path: " << bindAddress.getSunPath().data();
92 } else {
93 PLOG(ERROR) << "Removed stalled sun path: " << bindAddress.getSunPath().data();
94 }
95 }
96 } else {
97 PLOG(ERROR) << "Locking lock file " << bindAddress.getSunPath().append(".lock").data();
98
101 }
102 } else {
103 PLOG(ERROR) << "Opening lock file: " << bindAddress.getSunPath().append(".lock").data();
104 }
105 }
106
107 return Super::bind(bindAddress);
108 }
int open(const char *pathname, int flags)