1
0
Fork 0
mirror of https://passt.top/passt synced 2025-05-26 02:55:35 +02:00

passt, util: Move opening of PID file to its own function

We won't call it from main() any longer: move it.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
This commit is contained in:
Stefano Brivio 2024-05-22 19:50:58 +02:00
parent 57d8aa8ffe
commit ba23b05545
3 changed files with 25 additions and 9 deletions

1
util.h
View file

@ -156,6 +156,7 @@ char *line_read(char *buf, size_t len, int fd);
void ns_enter(const struct ctx *c);
bool ns_is_init(void);
int open_in_ns(const struct ctx *c, const char *path, int flags);
int pidfile_open(const char *path);
void pidfile_write(int fd, pid_t pid);
int __daemon(int pidfile_fd, int devnull_fd);
int fls(unsigned long x);