MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pidfile_verify

Function pidfile_verify

tools/libutil/pidfile.c:59–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57static int _pidfile_remove(struct pidfh *pfh, int freeit);
58
59static int
60pidfile_verify(const struct pidfh *pfh)
61{
62 struct stat sb;
63
64 if (pfh == NULL || pfh->pf_fd == -1)
65 return (EDOOFUS);
66 /*
67 * Check remembered descriptor.
68 */
69 if (fstat(pfh->pf_fd, &sb) == -1)
70 return (errno);
71 if (sb.st_dev != pfh->pf_dev || sb.st_ino != pfh->pf_ino)
72 return (EDOOFUS);
73 return (0);
74}
75
76static int
77pidfile_read(int dirfd, const char *filename, pid_t *pidptr)

Callers 3

pidfile_writeFunction · 0.85
pidfile_closeFunction · 0.85
_pidfile_removeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected