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

Function pw_fini

tools/libutil/pw_util.c:354–376  ·  view source on GitHub ↗

* Clean up. Preserve errno for the caller's convenience. */

Source from the content-addressed store, hash-verified

352 * Clean up. Preserve errno for the caller's convenience.
353 */
354void
355pw_fini(void)
356{
357 int serrno, status;
358
359 if (!initialized)
360 return;
361 initialized = 0;
362 serrno = errno;
363 if (editpid != -1) {
364 kill(editpid, SIGTERM);
365 kill(editpid, SIGCONT);
366 waitpid(editpid, &status, 0);
367 editpid = -1;
368 }
369 if (*tempname != '\0') {
370 unlink(tempname);
371 *tempname = '\0';
372 }
373 if (lockfd != -1)
374 close(lockfd);
375 errno = serrno;
376}
377
378/*
379 * Compares two struct pwds.

Callers

nothing calls this directly

Calls 2

killFunction · 0.85
closeFunction · 0.50

Tested by

no test coverage detected