1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 14:51:16 +02:00

Merge pull request #12854 from NixOS/mergify/bp/2.24-maintenance/pr-12765

Add various clang tidy fixes (backport #12765)
This commit is contained in:
mergify[bot] 2025-04-01 14:35:45 +00:00 committed by GitHub
commit b47bd02a6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 3 deletions

View file

@ -1025,6 +1025,7 @@ void processConnection(
{ {
#ifndef _WIN32 // TODO need graceful async exit support on Windows? #ifndef _WIN32 // TODO need graceful async exit support on Windows?
auto monitor = !recursive ? std::make_unique<MonitorFdHup>(from.fd) : nullptr; auto monitor = !recursive ? std::make_unique<MonitorFdHup>(from.fd) : nullptr;
(void) monitor; // suppress warning
#endif #endif
/* Exchange the greeting. */ /* Exchange the greeting. */

View file

@ -345,7 +345,7 @@ LocalStore::LocalStore(
else if (curSchema == 0) { /* new store */ else if (curSchema == 0) { /* new store */
curSchema = nixSchemaVersion; curSchema = nixSchemaVersion;
openDB(*state, true); openDB(*state, true);
writeFile(schemaPath, fmt("%1%", nixSchemaVersion), 0666, true); writeFile(schemaPath, fmt("%1%", curSchema), 0666, true);
} }
else if (curSchema < nixSchemaVersion) { else if (curSchema < nixSchemaVersion) {

View file

@ -33,7 +33,7 @@ std::optional<Mode> decodeMode(RawMode m) {
static std::string getStringUntil(Source & source, char byte) static std::string getStringUntil(Source & source, char byte)
{ {
std::string s; std::string s;
char n[1]; char n[1] = { 0 };
source(std::string_view { n, 1 }); source(std::string_view { n, 1 });
while (*n != byte) { while (*n != byte) {
s += *n; s += *n;

View file

@ -19,7 +19,7 @@ int main(int argc, char **argv) {
struct sockaddr_un data; struct sockaddr_un data;
data.sun_family = AF_UNIX; data.sun_family = AF_UNIX;
data.sun_path[0] = 0; data.sun_path[0] = 0;
strcpy(data.sun_path + 1, argv[1]); strncpy(data.sun_path + 1, argv[1], sizeof(data.sun_path) - 2);
// Now try to connect, To ensure we work no matter what order we are // Now try to connect, To ensure we work no matter what order we are
// executed in, just busyloop here. // executed in, just busyloop here.

View file

@ -5,6 +5,7 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <assert.h> #include <assert.h>
#include <string.h>
int main(int argc, char **argv) { int main(int argc, char **argv) {