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. Re: [RFC 2/4] main: Make -d option repeatable (Slava Monich)
2. Re: [RFC 2/4] main: Make -d option repeatable (Daniel Wagner)
3. Re: [RFC 2/4] main: Make -d option repeatable (Slava Monich)
----------------------------------------------------------------------
Message: 1
Date: Thu, 6 Oct 2016 16:37:18 +0300
From: Slava Monich <[email protected]>
To: Daniel Wagner <[email protected]>, [email protected]
Subject: Re: [RFC 2/4] main: Make -d option repeatable
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
On 06/10/16 15:48, Daniel Wagner wrote:
> From: Slava Monich <[email protected]>
>
> Concatenating the patterns makes more sense than using the last
> supplied value and leaking the previous allocated patterns.
>
> [wagi: make also -d option without argument repeatable]
> ---
> src/main.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/src/main.c b/src/main.c
> index fdb4f724cf75..db97cd54fb43 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -476,10 +476,17 @@ static gboolean option_version = FALSE;
> static bool parse_debug(const char *key, const char *value,
> gpointer user_data, GError **error)
> {
> - if (value)
> + if (!value)
> + value = "*";
> +
> + if (option_debug) {
> + char *prev = option_debug;
> +
> + option_debug = g_strconcat(prev, ",", value, NULL);
> + g_free(prev);
> + } else {
> option_debug = g_strdup(value);
> - else
> - option_debug = g_strdup("*");
> + }
>
> return true;
> }
Hmm,
The only difference from my patch is that if no value is passed in, my
patch would overwrite the existing pattern with a single "*", and yours
would append "*" to it. Why is that important?
Cheers,
-Slava
------------------------------
Message: 2
Date: Thu, 6 Oct 2016 16:04:04 +0200
From: Daniel Wagner <[email protected]>
To: Slava Monich <[email protected]>, [email protected]
Subject: Re: [RFC 2/4] main: Make -d option repeatable
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
> The only difference from my patch is that if no value is passed in, my
> patch would overwrite the existing pattern with a single "*", and yours
> would append "*" to it. Why is that important?
Yes, that is the important bit. So if you provide -d you would set all
descriptors->counter to 1, with -dd the counter is set to 2 for the
debug level
------------------------------
Message: 3
Date: Thu, 6 Oct 2016 17:25:08 +0300
From: Slava Monich <[email protected]>
To: Daniel Wagner <[email protected]>, [email protected]
Subject: Re: [RFC 2/4] main: Make -d option repeatable
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
On 06/10/16 17:04, Daniel Wagner wrote:
>> The only difference from my patch is that if no value is passed in, my
>> patch would overwrite the existing pattern with a single "*", and yours
>> would append "*" to it. Why is that important?
>
> Yes, that is the important bit. So if you provide -d you would set all
> descriptors->counter to 1, with -dd the counter is set to 2 for the
> debug level
>
Ah, I missed that part. Now it makes sense.
Cheers,
-Slava
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 12, Issue 6
**************************************