Several fixes for goodbye in NetBSD

This commit is contained in:
Michiel Broek 2004-11-29 22:45:06 +00:00
parent 27441cd862
commit 7853f49519

View File

@ -93,11 +93,10 @@ void Good_Bye(int onsig)
offset = usrconfighdr.hdrsize + (grecno * usrconfighdr.recsize); offset = usrconfighdr.hdrsize + (grecno * usrconfighdr.recsize);
if (fseek(pUsrConfig, offset, SEEK_SET) != 0) { if (fseek(pUsrConfig, offset, SEEK_SET) != 0) {
WriteError("Can't move pointer in file %s", temp); WriteError("$Can't move pointer in file %s/etc/users.data", getenv("MBSE_ROOT"));
ExitClient(MBERR_GENERAL); } else {
fwrite(&usrconfig, sizeof(usrconfig), 1, pUsrConfig);
} }
fwrite(&usrconfig, sizeof(usrconfig), 1, pUsrConfig);
fclose(pUsrConfig); fclose(pUsrConfig);
} }
} }
@ -111,12 +110,18 @@ void Good_Bye(int onsig)
sleep(4); sleep(4);
} }
for (i = 0; i < NSIG; i++) for (i = 0; i < NSIG; i++) {
signal(i, SIG_IGN); if (i == SIGCHLD)
signal(i, SIG_DFL);
else if ((i != SIGKILL) && (i != SIGSTOP))
signal(i, SIG_IGN);
}
Syslog('b', "Will hangup"); if ((onsig != SIGALRM) && (onsig != MBERR_TIMEOUT) && (hanged_up == 0)) {
cookedport(); cookedport();
hangup(); }
Syslog('b', "Will hangup");
hangup();
Syslog('b', "Done"); Syslog('b', "Done");
if (do_mailout) if (do_mailout)