daemon: Fix several format strings.

This is a followup to 3af52f845f and
6f1448ef89.

* nix/libstore/local-store.cc (LocalStore::queryValidPathId): Change %1% to {}.
* nix/libstore/optimise-store.cc (LocalStore::optimisePath_): Likewise.
* nix/nix-daemon/guix-daemon.cc (open_unix_domain_socket): Likewise.
(main): Likewise.
* nix/libutil/affinity.cc (restoreAffinity): Remove useless %1%.

Change-Id: I3a7cd79cd69ab58f14118662f1dcf2fef067a6b7
This commit is contained in:
Ludovic Courtès 2026-01-12 09:15:03 +01:00
parent 94579edc3f
commit 5ff038473e
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
4 changed files with 15 additions and 14 deletions

View file

@ -654,7 +654,7 @@ uint64_t LocalStore::queryValidPathId(const Path & path)
{
auto use(stmtQueryPathInfo.use()(path));
if (!use.next())
throw Error(std::format("path `%1%' is not valid", path));
throw Error(std::format("path `{}' is not valid", path));
return use.getInt(0);
}

View file

@ -182,12 +182,12 @@ void LocalStore::optimisePath_(OptimiseStats & stats, const Path & path, InodeHa
}
if (st.st_size != stLink.st_size) {
printMsg(lvlError, std::format("removing corrupted link `%1%'", linkPath));
printMsg(lvlError, std::format("removing corrupted link `{}'", linkPath));
unlink(linkPath.c_str());
goto retry;
}
printMsg(lvlTalkative, std::format("linking `%1%' to `%2%'", path, linkPath));
printMsg(lvlTalkative, std::format("linking `{}' to `{}'", path, linkPath));
/* Make the containing directory writable, but only if it's not
the store itself (we don't want or need to mess with its

View file

@ -49,7 +49,7 @@ void restoreAffinity()
#if HAVE_SCHED_SETAFFINITY
if (!didSaveAffinity) return;
if (sched_setaffinity(0, sizeof(cpu_set_t), &savedAffinity) == -1)
printMsg(lvlError, "failed to restore affinity %1%");
printMsg(lvlError, "failed to restore affinity");
#endif
}

View file

@ -329,8 +329,8 @@ open_unix_domain_socket (const char *file)
struct sockaddr_un addr;
addr.sun_family = AF_UNIX;
if (fileRel.size () >= sizeof (addr.sun_path))
throw Error (std::vformat( (_("socket file name '%1%' is too long")),
std::make_format_args(fileRel)));
throw Error (std::vformat ((_("socket file name '{}' is too long")),
std::make_format_args (fileRel)));
strcpy (addr.sun_path, fileRel.c_str ());
unlink (file);
@ -523,14 +523,15 @@ main (int argc, char *argv[])
/* We were not "socket-activated" so open the sockets specified by
LISTEN_OPTIONS. */
sockets = listening_sockets (listen_options);
else {
auto size = sockets.size();
printMsg (lvlInfo,
std::vformat((ngettext ("socket-activated with %1% socket",
"socket-activated with %1% sockets",
size)),
std::make_format_args(size)));
}
else
{
auto size = sockets.size();
printMsg (lvlInfo,
std::vformat((ngettext ("socket-activated with {} socket",
"socket-activated with {} sockets",
size)),
std::make_format_args(size)));
}
/* Effect all the changes made via 'settings.set'. */
settings.update ();