ALT Linux Bugzilla
– Attachment 1657 Details for
Bug 10095
pppd виснет при получении SIGTERM во время выполнения chat, etc.
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Патч, который вроде как фиксит все указанные ошибки
ppp-2.4.2-lvu-sigterm.patch (text/plain), 3.40 KB, created by
Valentin Lavrinenko
on 2006-10-06 10:28:42 MSD
(
hide
)
Description:
Патч, который вроде как фиксит все указанные ошибки
Filename:
MIME Type:
Creator:
Valentin Lavrinenko
Created:
2006-10-06 10:28:42 MSD
Size:
3.40 KB
patch
obsolete
>diff -ru ppp-2.4.2/pppd/main.c ppp-2.4.2-new/pppd/main.c >--- ppp-2.4.2/pppd/main.c 2004-01-13 06:00:34 +0200 >+++ ppp-2.4.2-new/pppd/main.c 2006-09-26 17:09:15 +0300 >@@ -177,6 +177,8 @@ > > int error_count; > >+sigset_t ignored_signals; /* to be ignored due to kill_my_pg() call */ >+ > /* > * We maintain a list of child process pids and > * functions to call when they exit. >@@ -217,7 +219,6 @@ > static void cleanup_db __P((void)); > #endif > >-static void handle_events __P((void)); > static void print_link_stats __P((void)); > > extern char *ttyname __P((int)); >@@ -644,7 +647,7 @@ > /* > * handle_events - wait for something to happen and respond to it. > */ >-static void >+void > handle_events() > { > struct timeval timo; >@@ -767,6 +770,8 @@ > * be sufficient. > */ > signal(SIGPIPE, SIG_IGN); >+ >+ sigemptyset(&ignored_signals); > } > > /* >@@ -1334,13 +1339,15 @@ > kill_my_pg(sig) > int sig; > { >- struct sigaction act, oldact; >- >- act.sa_handler = SIG_IGN; >- act.sa_flags = 0; >- sigaction(sig, &act, &oldact); >- kill(0, sig); >- sigaction(sig, &oldact, NULL); >+ if (sigismember(&ignored_signals, sig)) >+ { >+ sigdelset(&ignored_signals, sig); >+ } >+ else >+ { >+ sigaddset(&ignored_signals, sig); >+ kill(0, sig); >+ } > } > > >@@ -1382,6 +1389,7 @@ > /* Send the signal to the [dis]connector process(es) also */ > kill_my_pg(sig); > notify(sigreceived, sig); >+ status = EXIT_USER_REQUEST; > if (waiting) > siglongjmp(sigjmp, 1); > } >Only in ppp-2.4.2-new/pppd: main.c~ >Only in ppp-2.4.2-new/pppd: Makefile >diff -ru ppp-2.4.2/pppd/pppd.h ppp-2.4.2-new/pppd/pppd.h >--- ppp-2.4.2/pppd/pppd.h 2003-04-07 03:01:46 +0300 >+++ ppp-2.4.2-new/pppd/pppd.h 2006-09-26 16:49:28 +0300 >@@ -456,6 +456,7 @@ > */ > > /* Procedures exported from main.c. */ >+void handle_events __P((void)); /* wait for smth to happen and respond to it*/ > void set_ifunit __P((int)); /* set stuff that depends on ifunit */ > void detach __P((void)); /* Detach from controlling tty */ > void die __P((int)); /* Cleanup and exit */ >diff -ru ppp-2.4.2/pppd/sys-linux.c ppp-2.4.2-new/pppd/sys-linux.c >--- ppp-2.4.2/pppd/sys-linux.c 2004-01-13 06:05:20 +0200 >+++ ppp-2.4.2-new/pppd/sys-linux.c 2006-09-26 16:04:02 +0300 >@@ -995,7 +995,9 @@ > if (!default_device) > inittermios.c_lflag &= ~(ECHO | ECHONL); > >- if (tcsetattr(tty_fd, TCSAFLUSH, &inittermios) < 0) { >+ // Ugly hack - with TCSAFLUSH it hangs if no modem is connected >+ // to COM port. >+ if (tcsetattr(tty_fd, TCSANOW, &inittermios) < 0) { > if (! ok_error (errno)) > warn("tcsetattr: %m (line %d)", __LINE__); > } >diff -ru ppp-2.4.2/pppd/tty.c ppp-2.4.2-new/pppd/tty.c >--- ppp-2.4.2/pppd/tty.c 2004-01-13 06:17:59 +0200 >+++ ppp-2.4.2-new/pppd/tty.c 2006-09-26 16:53:11 +0300 >@@ -671,6 +671,7 @@ > status = EXIT_INIT_FAILED; > return -1; > } >+ handle_events(); > if (kill_link) { > disconnect_tty(); > return -1; >@@ -681,9 +682,11 @@ > if (connector && connector[0]) { > if (device_script(connector, ttyfd, ttyfd, 0) < 0) { > error("Connect script failed"); >- status = EXIT_CONNECT_FAILED; >+ if (status != EXIT_USER_REQUEST) >+ status = EXIT_CONNECT_FAILED; > return -1; > } >+ handle_events(); > if (kill_link) { > disconnect_tty(); > return -1; >@@ -710,6 +713,7 @@ > error("Failed to reopen %s: %m", devnam); > status = EXIT_OPEN_FAILED; > } >+ handle_events(); > if (!persist || errno != EINTR || hungup || kill_link) > return -1; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 10095
:
1656
| 1657