MCPcopy Index your code
hub / github.com/RsyncProject/rsync / kill_all

Function kill_all

util1.c:612–629  ·  view source on GitHub ↗

* Kill all children. * * @todo It would be kind of nice to make sure that they are actually * all our children before we kill them, because their pids may have * been recycled by some other process. Perhaps when we wait for a * child, we should remove it from this array. Alternatively we could * perhaps use process groups, but I think that would not work on * ancient Unix versions that do

Source from the content-addressed store, hash-verified

610 * ancient Unix versions that don't support them.
611 **/
612void kill_all(int sig)
613{
614 int i;
615
616 for (i = 0; i < num_pids; i++) {
617 /* Let's just be a little careful where we
618 * point that gun, hey? See kill(2) for the
619 * magic caused by negative values. */
620 pid_t p = all_pids[i];
621
622 if (p == getpid())
623 continue;
624 if (p <= 0)
625 continue;
626
627 kill(p, sig);
628 }
629}
630
631/** Lock a byte range in a open file */
632int lock_range(int fd, int offset, int len)

Callers 1

_exit_cleanupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected