Skip to content

Commit 15b222b

Browse files
authored
Merge pull request #14650 from xokdvium/double-quotes-lockfiles
libstore: Fix double quotes in debug logs for pathlocks
2 parents c383495 + 3716bd9 commit 15b222b

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/libstore/unix/pathlocks.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ AutoCloseFD openLockFile(const std::filesystem::path & path, bool create)
1919

2020
fd = open(path.c_str(), O_CLOEXEC | O_RDWR | (create ? O_CREAT : 0), 0600);
2121
if (!fd && (create || errno != ENOENT))
22-
throw SysError("opening lock file '%1%'", path);
22+
throw SysError("opening lock file %1%", path);
2323

2424
return fd;
2525
}
@@ -83,7 +83,7 @@ bool PathLocks::lockPaths(const std::set<std::filesystem::path> & paths, const s
8383
checkInterrupt();
8484
std::filesystem::path lockPath = path + ".lock";
8585

86-
debug("locking path '%1%'", path);
86+
debug("locking path %1%", path);
8787

8888
AutoCloseFD fd;
8989

@@ -106,19 +106,19 @@ bool PathLocks::lockPaths(const std::set<std::filesystem::path> & paths, const s
106106
}
107107
}
108108

109-
debug("lock acquired on '%1%'", lockPath);
109+
debug("lock acquired on %1%", lockPath);
110110

111111
/* Check that the lock file hasn't become stale (i.e.,
112112
hasn't been unlinked). */
113113
struct stat st;
114114
if (fstat(fd.get(), &st) == -1)
115-
throw SysError("statting lock file '%1%'", lockPath);
115+
throw SysError("statting lock file %1%", lockPath);
116116
if (st.st_size != 0)
117117
/* This lock file has been unlinked, so we're holding
118118
a lock on a deleted file. This means that other
119119
processes may create and acquire a lock on
120120
`lockPath', and proceed. So we must retry. */
121-
debug("open lock file '%1%' has become stale", lockPath);
121+
debug("open lock file %1% has become stale", lockPath);
122122
else
123123
break;
124124
}
@@ -137,9 +137,9 @@ void PathLocks::unlock()
137137
deleteLockFile(i.second, i.first);
138138

139139
if (close(i.first) == -1)
140-
printError("error (ignored): cannot close lock file on '%1%'", i.second);
140+
printError("error (ignored): cannot close lock file on %1%", i.second);
141141

142-
debug("lock released on '%1%'", i.second);
142+
debug("lock released on %1%", i.second);
143143
}
144144

145145
fds.clear();

src/libstore/windows/pathlocks.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ void PathLocks::unlock()
2828
deleteLockFile(i.second, i.first);
2929

3030
if (CloseHandle(i.first) == -1)
31-
printError("error (ignored): cannot close lock file on '%1%'", i.second);
31+
printError("error (ignored): cannot close lock file on %1%", i.second);
3232

33-
debug("lock released on '%1%'", i.second);
33+
debug("lock released on %1%", i.second);
3434
}
3535

3636
fds.clear();
@@ -111,7 +111,7 @@ bool PathLocks::lockPaths(const std::set<std::filesystem::path> & paths, const s
111111
checkInterrupt();
112112
std::filesystem::path lockPath = path;
113113
lockPath += L".lock";
114-
debug("locking path '%1%'", path);
114+
debug("locking path %1%", path);
115115

116116
AutoCloseFD fd;
117117

@@ -128,13 +128,13 @@ bool PathLocks::lockPaths(const std::set<std::filesystem::path> & paths, const s
128128
}
129129
}
130130

131-
debug("lock acquired on '%1%'", lockPath);
131+
debug("lock acquired on %1%", lockPath);
132132

133133
struct _stat st;
134134
if (_fstat(fromDescriptorReadOnly(fd.get()), &st) == -1)
135-
throw SysError("statting lock file '%1%'", lockPath);
135+
throw SysError("statting lock file %1%", lockPath);
136136
if (st.st_size != 0)
137-
debug("open lock file '%1%' has become stale", lockPath);
137+
debug("open lock file %1% has become stale", lockPath);
138138
else
139139
break;
140140
}

0 commit comments

Comments
 (0)