|
Lines 964-970
Link Here
|
| 964 |
{ |
964 |
{ |
| 965 |
int save_errno = errno; |
965 |
int save_errno = errno; |
| 966 |
|
966 |
|
| 967 |
if (parent_pid != -1 && kill(parent_pid, 0) < 0) { |
967 |
/* |
|
|
968 |
* Don't just test whether kill(parent_pid,0) is successful, |
| 969 |
* because it may fail with EPERM even if the process exists. |
| 970 |
* If our parent has exited then getppid() will return (pid_t)1, |
| 971 |
* so testing for that should be safe. |
| 972 |
*/ |
| 973 |
if (parent_pid != -1 && getppid() != parent_pid) { |
| 968 |
/* printf("Parent has died - Authentication agent exiting.\n"); */ |
974 |
/* printf("Parent has died - Authentication agent exiting.\n"); */ |
| 969 |
cleanup_handler(sig); /* safe */ |
975 |
cleanup_handler(sig); /* safe */ |
| 970 |
} |
976 |
} |