pidref: make PIDREF_NULL const

That way compiler can put it in an immutable section
This commit is contained in:
Lennart Poettering
2023-10-19 17:09:41 +02:00
committed by Luca Boccassi
parent 759cca0348
commit 9bb64f1b8d

View 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) */