tree-wide: add a single version of "static const int one = 1"

All over the place we define local variables for the various sockopts
that take a bool-like "int" value. Sometimes they are const, sometimes
static, sometimes both, sometimes neither.

Let's clean this up, introduce a common const variable "const_int_one"
(as well as one matching "const_int_zero") and use it everywhere, all
acorss the codebase.
This commit is contained in:
Lennart Poettering
2018-10-15 19:40:51 +02:00
parent 8e8132c6b8
commit 6d5e65f645
24 changed files with 104 additions and 128 deletions
+3
View File
@@ -51,6 +51,9 @@ int saved_argc = 0;
char **saved_argv = NULL;
static int saved_in_initrd = -1;
const int const_int_zero = 0;
const int const_int_one = 1;
size_t page_size(void) {
static thread_local size_t pgsz = 0;
long r;