* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define RCSID "$Id: main.c,v 1.127 2003/05/12 07:31:36 fcusack Exp $"
+#define RCSID "$Id: main.c,v 1.132 2004/02/02 02:52:51 carlsonj Exp $"
#include <stdio.h>
#include <ctype.h>
#include "ipv6cp.h"
#endif
#include "upap.h"
-#include "chap.h"
+#include "chap-new.h"
#include "eap.h"
#include "ccp.h"
#include "ecp.h"
*/
disconnect:
new_phase(PHASE_DISCONNECT);
- the_channel->disconnect();
+ if (the_channel->disconnect)
+ the_channel->disconnect();
fail:
if (the_channel->cleanup)
info("Connect time %d.%d minutes.", t/10, t%10);
info("Sent %u bytes, received %u bytes.",
link_stats.bytes_out, link_stats.bytes_in);
+ link_stats_valid = 0;
}
}
act.sa_handler = SIG_IGN;
act.sa_flags = 0;
- kill(0, sig);
sigaction(sig, &act, &oldact);
+ kill(0, sig);
sigaction(sig, &oldact, NULL);
}
int pid;
int status = -1;
int errfd;
+ int fd;
++conn_running;
pid = safe_fork();
/* here we are executing in the child */
+ /* make sure fds 0, 1, 2 are occupied */
+ while ((fd = dup(in)) >= 0) {
+ if (fd > 2) {
+ close(fd);
+ break;
+ }
+ }
+
/* dup in and out to fds > 2 */
{
int fd1 = in, fd2 = out, fd3 = log_to_fd;