board: meaningful return value is assigned to a variable like read() 96/154496/4
authorSegwon <segwon.han@samsung.com>
Tue, 10 Oct 2017 10:02:24 +0000 (19:02 +0900)
committerSegwon Han <segwon.han@samsung.com>
Tue, 10 Oct 2017 12:15:34 +0000 (12:15 +0000)
Change-Id: I07e1db5b35cc071b4d28f9aac4f685c714e8edb2
Signed-off-by: Segwon <segwon.han@samsung.com>
src/daemon/peripheral_bus_board.c

index bfc3508..cb1720b 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;
        }