diff options
author | Kristen Carlson Accardi <kristen@linux.intel.com> | 2010-03-24 21:41:55 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-03-25 06:50:17 -0700 |
commit | 5b656cdf347dcc03eece3f81b58a8ae19e9b20a9 (patch) | |
tree | 05c7a09d556bfe5918ae98f68188b17280fdd657 /gatchat/gsmdial.c | |
parent | f720a27a1f41c9fe8f079df5252f5535ad6338f4 (diff) | |
download | ofono-5b656cdf347dcc03eece3f81b58a8ae19e9b20a9.tar.gz |
gsmdial: shutdown ppp link if we have one
If we have created a ppp link, shut it down when the signal handler
is called.
Diffstat (limited to 'gatchat/gsmdial.c')
-rw-r--r-- | gatchat/gsmdial.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gatchat/gsmdial.c b/gatchat/gsmdial.c index aee9eea8..a18f4862 100644 --- a/gatchat/gsmdial.c +++ b/gatchat/gsmdial.c @@ -101,6 +101,8 @@ static gboolean signal_cb(GIOChannel *channel, GIOCondition cond, gpointer data) case SIGTERM: if (terminated == 0) { char buf[64]; + if (ppp) + g_at_ppp_shutdown(ppp); g_timeout_add_seconds(10, quit_eventloop, NULL); sprintf(buf, "AT+CFUN=%u", option_offmode); @@ -285,7 +287,7 @@ static void connect_cb(gboolean ok, GAtResult *result, gpointer user_data) ppp = g_at_ppp_new(channel); if (!ppp) { g_print("Unable to create PPP object\n"); - return; + exit(1); } g_at_ppp_set_credentials(ppp, option_username, option_password); |