0d004db Revert "pppd: Include time.h before using time_t" e400854 pppdump: Eliminate printf format warning by using %zd 7f2f0de pppd: Refactor setjmp/longjmp with pipe pair in event wait loop 4e71317 make: Avoid using host include for cross-compiling 3202f89 pppoe: Remove the use of cdefs d8e8d7a pppd: Remove unused rcsid variables 486f854 pppd: Fix GLIBC version test for non-glibc toolchains b6cd558 pppd: Include time.h before using time_t ef8ec11 radius: Fix compiler warning f6330ec magic: Remove K&R style of arguments 347904e Add Submitting-patches.md Remove patches 130-no_cdefs_h.patch, 131-missing_prototype_macro.patch, 132-fix_linux_includes.patch as fixed upstream Refresh patches Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
24 lines
766 B
Diff
24 lines
766 B
Diff
pppd: Do not clobber exit codes on hangup
|
|
|
|
When a modem hangup occurs, pppd unconditionally sets the exit status code
|
|
to EXIT_HANGUP. This patch only sets EXIT_HANGUP if the exit status code is
|
|
not already set to an error value.
|
|
|
|
The motiviation of this patch is to allow applications which remote control
|
|
pppd to react properly on errors, e.g. only redial (relaunch pppd) if there
|
|
was a hangup, but not if the CHAP authentication failed.
|
|
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
|
|
--- a/pppd/main.c
|
|
+++ b/pppd/main.c
|
|
@@ -1051,7 +1051,8 @@ get_input()
|
|
}
|
|
notice("Modem hangup");
|
|
hungup = 1;
|
|
- status = EXIT_HANGUP;
|
|
+ if (status == EXIT_OK)
|
|
+ status = EXIT_HANGUP;
|
|
lcp_lowerdown(0); /* serial link is no longer available */
|
|
link_terminated(0);
|
|
return;
|