Maybe a mistake in function parse_state_file
- From: Chen Jie <chenj lemote com>
- To: Dan Williams <dcbw redhat com>
- Cc: networkmanager-list gnome org
- Subject: Maybe a mistake in function parse_state_file
- Date: Tue, 22 Dec 2009 12:42:24 +0800
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);
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]