Check the return value of close.(missing one)
authorSung-jae Park <nicesj.park@samsung.com>
Tue, 13 Aug 2013 01:32:00 +0000 (10:32 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Tue, 13 Aug 2013 01:32:00 +0000 (10:32 +0900)
[model] Redwood
[binary_type] AP
[customer] Docomo/Orange/Open
[issue#] N/A
[problem]
[cause]
[solution]
[team] HomeTF
[request]
[horizontal_expansion]

Change-Id: Ibf6ab1299bcb6f09371856b02e7a610752405348

src/fb.c

index f37a33f..89c19a4 100644 (file)
--- a/src/fb.c
+++ b/src/fb.c
@@ -144,7 +144,9 @@ static inline int sync_for_file(struct fb_info *info)
 
        if (read(fd, buffer->data, info->bufsz) != info->bufsz) {
                ErrPrint("read: %s\n", strerror(errno));
-               close(fd);
+               if (close(fd) < 0) {
+                       ErrPrint("close: %s\n", strerror(errno));
+               }
 
                /*!
                 * \note
@@ -156,7 +158,9 @@ static inline int sync_for_file(struct fb_info *info)
                return LB_STATUS_SUCCESS;
        }
 
-       close(fd);
+       if (close(fd) < 0) {
+               ErrPrint("close: %s\n", strerror(errno));
+       }
        return LB_STATUS_SUCCESS;
 }