From: Andrei Emeltchenko <andrei.emeltchenko.news@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Frederic Danis <frederic.danis@linux.intel.com>,
linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/2] android: Android version of log.c
Date: Mon, 23 Sep 2013 10:48:36 +0300 [thread overview]
Message-ID: <20130923073733.GB8444@aemeltch-MOBL1> (raw)
In-Reply-To: <708DB870-5A40-4056-86C8-79092784757C@holtmann.org>
Hi all,
On Sat, Sep 21, 2013 at 12:20:52PM -0500, Marcel Holtmann wrote:
> Hi Fred,
> > +
> > +static void android_log(int pri, const char *fmt, va_list ap)
> > +{
> > + char *msg;
> > + struct iovec vec[3];
> > +
> > + msg = g_strdup_vprintf(fmt, ap);
> > +
> > + if (!detached) {
> > + vec[0].iov_base = (void *) msg;
> > + vec[0].iov_len = strlen(msg) + 1;
> > + vec[1].iov_base = "\n";
> > + vec[1].iov_len = 1;
> > + writev(STDERR_FILENO, vec, 2);
> > + }
>
> Lets not worry about logging to stderr at all.
Then I believe this might be simplified a lot. We might use
__android_log_print - like functions in this case.
Best regards
Andrei Emeltchenko
next prev parent reply other threads:[~2013-09-23 7:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-20 12:24 [PATCH 1/2] android: Add skeleton of BlueZ Android daemon Frederic Danis
2013-09-20 12:24 ` [PATCH 2/2] android: Android version of log.c Frederic Danis
2013-09-21 17:20 ` Marcel Holtmann
2013-09-23 7:48 ` Andrei Emeltchenko [this message]
2013-09-24 9:05 ` Frederic Danis
2013-09-27 1:58 ` Marcel Holtmann
2013-09-21 17:14 ` [PATCH 1/2] android: Add skeleton of BlueZ Android daemon Marcel Holtmann
2013-09-21 18:09 ` Johan Hedberg
2013-09-23 7:59 ` Andrei Emeltchenko
2013-09-23 9:51 ` Frederic Danis
2013-09-23 19:26 ` Lukasz Rymanowski
2013-09-23 19:28 ` Lukasz Rymanowski
2013-09-24 7:32 ` Andrei Emeltchenko
2013-09-27 1:56 ` Marcel Holtmann
2013-09-27 6:50 ` Andrei Emeltchenko
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=20130923073733.GB8444@aemeltch-MOBL1 \
--to=andrei.emeltchenko.news@gmail.com \
--cc=frederic.danis@linux.intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox