Change-Id: I515dbd75441176e234a97188762ccaf8af4d3016
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
Name: net-config
Summary: TIZEN Network Configuration service
Name: net-config
Summary: TIZEN Network Configuration service
Release: 3
Group: System/Network
License: Apache-2.0
Release: 3
Group: System/Network
License: Apache-2.0
INFO("Sending ARP Packet Failed. Error. = %s\n",
strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER));
/* close socket */
INFO("Sending ARP Packet Failed. Error. = %s\n",
strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER));
/* close socket */
- if (-1 < sd->chk_conflict_sd) {
- close(sd->chk_conflict_sd);
- sd->chk_conflict_sd = -1;
- }
+ close(sd->chk_conflict_sd);
+ sd->chk_conflict_sd = -1;
/* reopen socket */
if ((sd->chk_conflict_sd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ARP))) == -1) {
/* reopen socket */
if ((sd->chk_conflict_sd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ARP))) == -1) {
- chmod(pathname, S_IRUSR | S_IWUSR);
- DBG("Successfully saved keyfile %s", pathname);
+ if (chmod(pathname, S_IRUSR | S_IWUSR) < 0)
+ DBG("Failed to change mode");
+ else
+ DBG("Successfully saved keyfile %s", pathname);
- fseek(fp, 0L, SEEK_SET);
- rv = fscanf(fp, "%17s", bssid);
+ rv = fseek(fp, 0L, SEEK_SET);
+ if (rv != 0) {
+ ERR("Fail to seek file");
+ fclose(fp);
+ return;
+ }
+ rv = fscanf(fp, "%17s", bssid);
+ if (rv < 0) {
ERR("Fail to read bssid");
ERR("Fail to read bssid");
+ fclose(fp);
+ return;
+ }
netconfig_set_vconf_str(VCONF_WIFI_BSSID_ADDRESS, bssid);
netconfig_set_vconf_str(VCONF_WIFI_BSSID_ADDRESS, bssid);