static int detectOtherInstance(struct aXInfo *xinfo) { pid_t pid = getPidAtom(xinfo); int process_alive = kill(pid, 0); if (pid > 0 && process_alive == 0) { return 1; } if (process_alive) { perror("alock: info, found _ALOCK_PID"); } return 0; }
static int detectOtherInstance(struct aXInfo* xinfo) { pid_t pid = getPidAtom(xinfo); int process_alive = kill(pid, 0); (void) printf(" -: message alive=(%d) pid=[%d]\n", process_alive, pid); if (pid > 0 && process_alive == 0) { return 1; } if (process_alive) { perror("tlock: info, found _TLOCK_PID"); } return 0; }