diff options
| author | Congcong Kuo <congcong.kuo@gmail.com> | 2025-10-20 11:39:00 +0800 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-11-12 18:34:06 +0100 |
| commit | d1a9fb85a4d46722f06d01bde6f61acae3d9ea7a (patch) | |
| tree | 30aeae6c569b01d614ecc38a3e4eb86321a53ecd /nix/libutil/util.cc | |
| parent | 6fe5e7f70714735a7a365c73965fc0bfdb3f9f31 (diff) | |
daemon: Use inline functions and variables instead of extern
Avoid separate declarations and definitions for so-called 'global' objects.
* nix/libstore/derivations.{cc, hh} (drvHashes): Use inline instead of separate
declaration and definition.
* nix/libstore/globals.{cc, hh} (settings, nixVersion): Same.
* nix/libstore/local-store.hh (drvsLogDir, deduplicationMinSize): Same.
* nix/libstore/optimise-store.cc (deduplicationMinSize): Same.
* nix/libstore/store-api.{cc, hh} (store): Same.
* nix/libutil/archive.{cc, hh} (defaultPathFilter): Same.
* nix/libutil/hash.{cc, hh} (base32Chars): Same and modify header files.
* nix/libutil/util.{cc, hh} (logType, verbosity, _writeToStderr,
_isInterrupted): Same.
* nix/local.mk: Modified according to the rename of shared.hh.
* nix/nix-daemon/guix-daemon.cc (blockInt, argvSaved, run): Same and
modify header files.
* nix/nix-daemon/nix-daemon.cc: Modify header files.
* nix/nix-daemon/shared.hh: Renamed to nix-daemon.hh
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'nix/libutil/util.cc')
| -rw-r--r-- | nix/libutil/util.cc | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/nix/libutil/util.cc b/nix/libutil/util.cc index 22022db51a5..ed1a371dfe1 100644 --- a/nix/libutil/util.cc +++ b/nix/libutil/util.cc | |||
| @@ -600,9 +600,6 @@ void createSymlink(const Path & target, const Path & link) | |||
| 600 | } | 600 | } |
| 601 | 601 | ||
| 602 | 602 | ||
| 603 | LogType logType = ltPretty; | ||
| 604 | Verbosity verbosity = lvlInfo; | ||
| 605 | |||
| 606 | static int nestingLevel = 0; | 603 | static int nestingLevel = 0; |
| 607 | 604 | ||
| 608 | 605 | ||
| @@ -691,9 +688,6 @@ void writeToStderr(const string & s) | |||
| 691 | } | 688 | } |
| 692 | 689 | ||
| 693 | 690 | ||
| 694 | void (*_writeToStderr) (const unsigned char * buf, size_t count) = 0; | ||
| 695 | |||
| 696 | |||
| 697 | void readFull(int fd, unsigned char * buf, size_t count) | 691 | void readFull(int fd, unsigned char * buf, size_t count) |
| 698 | { | 692 | { |
| 699 | while (count) { | 693 | while (count) { |
| @@ -1250,7 +1244,6 @@ void keepOnExec(int fd) | |||
| 1250 | ////////////////////////////////////////////////////////////////////// | 1244 | ////////////////////////////////////////////////////////////////////// |
| 1251 | 1245 | ||
| 1252 | 1246 | ||
| 1253 | volatile sig_atomic_t _isInterrupted = 0; | ||
| 1254 | 1247 | ||
| 1255 | void _interrupted() | 1248 | void _interrupted() |
| 1256 | { | 1249 | { |
