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

Function pidfile_close

tools/libutil/pidfile.c:261–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261int
262pidfile_close(struct pidfh *pfh)
263{
264 int error;
265
266 error = pidfile_verify(pfh);
267 if (error != 0) {
268 errno = error;
269 return (-1);
270 }
271
272 if (close(pfh->pf_fd) == -1)
273 error = errno;
274 if (close(pfh->pf_dirfd) == -1 && error == 0)
275 error = errno;
276
277 free(pfh);
278 if (error != 0) {
279 errno = error;
280 return (-1);
281 }
282 return (0);
283}
284
285static int
286_pidfile_remove(struct pidfh *pfh, int freeit)

Callers 4

test_pidfile_uncontestedFunction · 0.85
test_pidfile_selfFunction · 0.85
test_pidfile_relativeFunction · 0.85

Calls 3

pidfile_verifyFunction · 0.85
closeFunction · 0.50
freeFunction · 0.50

Tested by 4

test_pidfile_uncontestedFunction · 0.68
test_pidfile_selfFunction · 0.68
test_pidfile_relativeFunction · 0.68