Update pidfile module from FreeBSD

Use EINVAL instead of EDOOFUS. Add a missing synopsis for
pidfile_fileno() in the man page. Move the definition of struct pidfh
from libutil.h into pidfile.c following upstream change.
This commit is contained in:
Guillem Jover
2018-05-20 19:18:18 +02:00
parent 3d88c999b4
commit facbddb652
4 changed files with 108 additions and 40 deletions

View File

@@ -48,13 +48,7 @@
#include <stdint.h>
#include <stdio.h>
/* for pidfile.c */
struct pidfh {
int pf_fd;
char *pf_path;
dev_t pf_dev;
ino_t pf_ino;
};
struct pidfh;
__BEGIN_DECLS
int humanize_number(char *buf, size_t len, int64_t bytes,
@@ -65,6 +59,7 @@ int flopen(const char *_path, int _flags, ...);
int flopenat(int dirfd, const char *path, int flags, ...);
struct pidfh *pidfile_open(const char *path, mode_t mode, pid_t *pidptr);
int pidfile_fileno(const struct pidfh *pfh);
int pidfile_write(struct pidfh *pfh);
int pidfile_close(struct pidfh *pfh);
int pidfile_remove(struct pidfh *pfh);