board: meaningful return value is assigned to a variable like read() 51/154551/1
authorSegwon <segwon.han@samsung.com>
Tue, 10 Oct 2017 10:02:24 +0000 (19:02 +0900)
committerSegwon <segwon.han@samsung.com>
Tue, 10 Oct 2017 11:59:39 +0000 (20:59 +0900)
Change-Id: I96837735750752cd0a6715ec5bbbe66a932af0d5
Signed-off-by: Segwon <segwon.han@samsung.com>
src/daemon/peripheral_bus_board.c

index bfc3508888a074e6ca80287adc9aab291131a888..cb1720b2a6fd93767e7d3d743105de119bd60e84 100644 (file)
@@ -119,7 +119,7 @@ static int peripheral_bus_board_ini_get_nkeys(dictionary *dict)
 
 static int peripheral_bus_board_get_type(void)
 {
-       int fd, i;
+       int fd, i, ret = 0;
        char str_buf[STR_BUF_MAX] = {0};
        int type = PB_BOARD_UNKNOWN;
 
@@ -130,8 +130,9 @@ static int peripheral_bus_board_get_type(void)
                return -ENXIO;
        }
 
-       if (read(fd, str_buf, STR_BUF_MAX) < 0) {
-               _E("Failed to read model information, path : %s", BOARD_DEVICE_TREE);
+       ret = read(fd, str_buf, STR_BUF_MAX);
+       if (ret < 0) {
+               _E("Failed to read model information, path: %s, ret: %d", BOARD_DEVICE_TREE, ret);
                close(fd);
                return -EIO;
        }