Send connman mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."
Today's Topics:
1. [PATCH] openvpn: Use proper logging function (Daniel Wagner)
----------------------------------------------------------------------
Message: 1
Date: Wed, 5 Oct 2016 15:44:08 +0200
From: Daniel Wagner <[email protected]>
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Subject: [PATCH] openvpn: Use proper logging function
Message-ID: <[email protected]>
From: Daniel Wagner <[email protected]>
We should use the connman_{debug|error} functions instead of a plain
printf for logging.
---
vpn/plugins/openvpn.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/vpn/plugins/openvpn.c b/vpn/plugins/openvpn.c
index 28adf3047d84..d48dca97c79d 100644
--- a/vpn/plugins/openvpn.c
+++ b/vpn/plugins/openvpn.c
@@ -312,6 +312,7 @@ static int task_append_config_data(struct vpn_provider
*provider,
static gboolean can_read_data(GIOChannel *chan,
GIOCondition cond, gpointer data)
{
+ void (*cbf)(const char *format, ...) = data;
gchar *str;
gsize size;
@@ -321,7 +322,7 @@ static gboolean can_read_data(GIOChannel *chan,
}
g_io_channel_read_line(chan, &str, &size, NULL, NULL);
- printf(str);
+ cbf(str);
g_free(str);
return TRUE;
@@ -334,7 +335,7 @@ static int setup_log_read(int stdout_fd, int stderr_fd)
chan = g_io_channel_unix_new(stdout_fd);
g_io_channel_set_close_on_unref(chan, TRUE);
- watch = g_io_add_watch(chan, G_IO_IN, can_read_data, NULL);
+ watch = g_io_add_watch(chan, G_IO_IN, can_read_data, connman_debug);
g_io_channel_unref(chan);
if (watch == 0)
@@ -342,7 +343,7 @@ static int setup_log_read(int stdout_fd, int stderr_fd)
chan = g_io_channel_unix_new(stderr_fd);
g_io_channel_set_close_on_unref(chan, TRUE);
- watch = g_io_add_watch(chan, G_IO_IN, can_read_data, NULL);
+ watch = g_io_add_watch(chan, G_IO_IN, can_read_data, connman_error);
g_io_channel_unref(chan);
return watch == 0? -EIO : 0;
--
2.7.4
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 12, Issue 4
**************************************