From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [RFC] gatchat: Print error message if opening tun failes
Date: Tue, 21 Aug 2012 15:00:14 +0200 [thread overview]
Message-ID: <1345554014.13726.85.camel@aeonflux> (raw)
In-Reply-To: <1345528828-28740-1-git-send-email-wagi@monom.org>
[-- Attachment #1: Type: text/plain, Size: 904 bytes --]
Hi Daniel,
> This is a very common misstake. Let's help the users to
> configure their system correctly.
> ---
> gatchat/ppp_net.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/gatchat/ppp_net.c b/gatchat/ppp_net.c
> index 1609b99..7082de7 100644
> --- a/gatchat/ppp_net.c
> +++ b/gatchat/ppp_net.c
> @@ -155,8 +155,12 @@ struct ppp_net *ppp_net_new(GAtPPP *ppp, int fd)
> if (fd < 0) {
> /* open a tun interface */
> fd = open("/dev/net/tun", O_RDWR);
> - if (fd < 0)
> + if (fd < 0) {
> + fprintf(stderr, "Couldn't open tun device. "
> + "Do you run oFono as root and do you "
> + "have the TUN module loaded?");
really, stderr?
> goto error;
> + }
>
> ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
> strcpy(ifr.ifr_name, "ppp%d");
Aren't the atom drivers checking this case for you?
Regards
Marcel
next prev parent reply other threads:[~2012-08-21 13:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 6:00 [RFC] gatchat: Print error message if opening tun failes Daniel Wagner
2012-08-21 13:00 ` Marcel Holtmann [this message]
2012-08-21 15:06 ` Daniel Wagner
2012-08-21 15:09 ` Daniel Wagner
2012-08-21 19:34 ` Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1345554014.13726.85.camel@aeonflux \
--to=marcel@holtmann.org \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.