]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pidref: make PIDREF_NULL const
authorLennart Poettering <lennart@poettering.net>
Thu, 19 Oct 2023 15:09:41 +0000 (17:09 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 19 Oct 2023 17:59:51 +0000 (18:59 +0100)
That way compiler can put it in an immutable section

src/basic/pidref.h

index 0fdc02a54bb78ca85333a7195a893d28e5b7e6b5..98ee0fef5c1062fb92fe2e5c44d2124adedb1af3 100644 (file)
@@ -9,7 +9,7 @@ typedef struct PidRef {
         int fd;    /* only valid if pidfd are available in the kernel, and we manage to get an fd */
 } PidRef;
 
-#define PIDREF_NULL (PidRef) { .fd = -EBADF }
+#define PIDREF_NULL (const PidRef) { .fd = -EBADF }
 
 /* Turns a pid_t into a PidRef structure on-the-fly *without* acquiring a pidfd for it. (As opposed to
  * pidref_set_pid() which does so *with* acquiring one, see below) */