summaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2026-01-12 09:15:03 +0100
committerLudovic Courtès <ludo@gnu.org>2026-01-12 10:56:37 +0100
commit5ff038473e3f3d6a84e69c712446ba3e200aa9b2 (patch)
tree931d4565e19c3c5075778581e951fe7ead83bb18 /nix
parent94579edc3fa4bd67ffe98c4170f391a2dd9b140a (diff)
daemon: Fix several format strings.
This is a followup to 3af52f845fe2ceb448416ac7b9f48925673c594e and 6f1448ef89c8ad29e2a479099531fd3a87701e46. * 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
Diffstat (limited to 'nix')
-rw-r--r--nix/libstore/local-store.cc2
-rw-r--r--nix/libstore/optimise-store.cc4
-rw-r--r--nix/libutil/affinity.cc2
-rw-r--r--nix/nix-daemon/guix-daemon.cc21
4 files changed, 15 insertions, 14 deletions
diff --git a/nix/libstore/local-store.cc b/nix/libstore/local-store.cc
index 43f3c1770a8..b8308b1aae5 100644
--- a/nix/libstore/local-store.cc
+++ b/nix/libstore/local-store.cc
@@ -654,7 +654,7 @@ uint64_t LocalStore::queryValidPathId(const Path & path)
654{ 654{
655 auto use(stmtQueryPathInfo.use()(path)); 655 auto use(stmtQueryPathInfo.use()(path));
656 if (!use.next()) 656 if (!use.next())
657 throw Error(std::format("path `%1%' is not valid", path)); 657 throw Error(std::format("path `{}' is not valid", path));
658 return use.getInt(0); 658 return use.getInt(0);
659} 659}
660 660
diff --git a/nix/libstore/optimise-store.cc b/nix/libstore/optimise-store.cc
index 54aa166c344..93ce1f55365 100644
--- a/nix/libstore/optimise-store.cc
+++ b/nix/libstore/optimise-store.cc
@@ -182,12 +182,12 @@ void LocalStore::optimisePath_(OptimiseStats & stats, const Path & path, InodeHa
182 } 182 }
183 183
184 if (st.st_size != stLink.st_size) { 184 if (st.st_size != stLink.st_size) {
185 printMsg(lvlError, std::format("removing corrupted link `%1%'", linkPath)); 185 printMsg(lvlError, std::format("removing corrupted link `{}'", linkPath));
186 unlink(linkPath.c_str()); 186 unlink(linkPath.c_str());
187 goto retry; 187 goto retry;
188 } 188 }
189 189
190 printMsg(lvlTalkative, std::format("linking `%1%' to `%2%'", path, linkPath)); 190 printMsg(lvlTalkative, std::format("linking `{}' to `{}'", path, linkPath));
191 191
192 /* Make the containing directory writable, but only if it's not 192 /* Make the containing directory writable, but only if it's not
193 the store itself (we don't want or need to mess with its 193 the store itself (we don't want or need to mess with its
diff --git a/nix/libutil/affinity.cc b/nix/libutil/affinity.cc
index 53500c22ab9..38270c0eb4c 100644
--- a/nix/libutil/affinity.cc
+++ b/nix/libutil/affinity.cc
@@ -49,7 +49,7 @@ void restoreAffinity()
49#if HAVE_SCHED_SETAFFINITY 49#if HAVE_SCHED_SETAFFINITY
50 if (!didSaveAffinity) return; 50 if (!didSaveAffinity) return;
51 if (sched_setaffinity(0, sizeof(cpu_set_t), &savedAffinity) == -1) 51 if (sched_setaffinity(0, sizeof(cpu_set_t), &savedAffinity) == -1)
52 printMsg(lvlError, "failed to restore affinity %1%"); 52 printMsg(lvlError, "failed to restore affinity");
53#endif 53#endif
54} 54}
55 55
diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc
index 341e39c2907..58a6f3eba45 100644
--- a/nix/nix-daemon/guix-daemon.cc
+++ b/nix/nix-daemon/guix-daemon.cc
@@ -329,8 +329,8 @@ open_unix_domain_socket (const char *file)
329 struct sockaddr_un addr; 329 struct sockaddr_un addr;
330 addr.sun_family = AF_UNIX; 330 addr.sun_family = AF_UNIX;
331 if (fileRel.size () >= sizeof (addr.sun_path)) 331 if (fileRel.size () >= sizeof (addr.sun_path))
332 throw Error (std::vformat( (_("socket file name '%1%' is too long")), 332 throw Error (std::vformat ((_("socket file name '{}' is too long")),
333 std::make_format_args(fileRel))); 333 std::make_format_args (fileRel)));
334 strcpy (addr.sun_path, fileRel.c_str ()); 334 strcpy (addr.sun_path, fileRel.c_str ());
335 335
336 unlink (file); 336 unlink (file);
@@ -523,14 +523,15 @@ main (int argc, char *argv[])
523 /* We were not "socket-activated" so open the sockets specified by 523 /* We were not "socket-activated" so open the sockets specified by
524 LISTEN_OPTIONS. */ 524 LISTEN_OPTIONS. */
525 sockets = listening_sockets (listen_options); 525 sockets = listening_sockets (listen_options);
526 else { 526 else
527 auto size = sockets.size(); 527 {
528 printMsg (lvlInfo, 528 auto size = sockets.size();
529 std::vformat((ngettext ("socket-activated with %1% socket", 529 printMsg (lvlInfo,
530 "socket-activated with %1% sockets", 530 std::vformat((ngettext ("socket-activated with {} socket",
531 size)), 531 "socket-activated with {} sockets",
532 std::make_format_args(size))); 532 size)),
533 } 533 std::make_format_args(size)));
534 }
534 535
535 /* Effect all the changes made via 'settings.set'. */ 536 /* Effect all the changes made via 'settings.set'. */
536 settings.update (); 537 settings.update ();