| 57 | static int _pidfile_remove(struct pidfh *pfh, int freeit); |
| 58 | |
| 59 | static int |
| 60 | pidfile_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 | |
| 76 | static int |
| 77 | pidfile_read(int dirfd, const char *filename, pid_t *pidptr) |
no outgoing calls
no test coverage detected