Re: Maybe a mistake in function parse_state_file
- From: Dan Williams <dcbw redhat com>
- To: Chen Jie <chenj lemote com>
- Cc: networkmanager-list gnome org
- Subject: Re: Maybe a mistake in function parse_state_file
- Date: Fri, 25 Dec 2009 14:35:53 -0600
On Tue, 2009-12-22 at 12:42 +0800, Chen Jie wrote:
> Hi Dan,
>
>
> I've just noticed line 376 of src/NetworkManager.c (in
> function parse_state_file, NM-0.7.2) may contain a mistake:
> wifi = g_key_file_get_boolean (state_file, "main", "WirelessEnabled",
> error);
Good catch. Fixed on 0.7 and 0.8, thanks!
Dan
>
> It uses variable "error" not "tmp_error", which makes the next line
> "if (tmp_error) ..." always false.
>
>
> The whole context (NM-0.7.2, src/NetworkManager.c):
> 369 net = g_key_file_get_boolean (state_file, "main",
> "NetworkingEnabled", &tmp_error); 370 if (tmp_error) 371
> g_set_error_literal (error, tmp_error->domain, tmp_error->code,
> tmp_error->messa ge); 372 else 373 *net_enabled = net; 374
> g_clear_error (&tmp_error); 375 376 wifi = g_key_file_get_boolean
> (state_file, "main", "WirelessEnabled", error); 377 if (tmp_error)
> { 378 g_clear_error (error); 379 g_set_error_literal (error,
> tmp_error->domain, tmp_error->code, tmp_error->messa ge); 380 } else
> 381 *wifi_enabled = wifi; 382 g_clear_error (&tmp_error);
>
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]