[minicoredumper] [PATCH 12/14] minicoredumper: Fix writing/reading from file descriptor

Mateusz Moscicki m.moscicki2 at partner.samsung.com
Tue May 21 14:52:48 CEST 2019


Change-Id: I699389dde1963369b5639c9876784f5dfab6bb76
---
 src/minicoredumper/corestripper.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/minicoredumper/corestripper.c b/src/minicoredumper/corestripper.c
index cb0bc2a..12f8de9 100644
--- a/src/minicoredumper/corestripper.c
+++ b/src/minicoredumper/corestripper.c
@@ -121,7 +121,8 @@ static ssize_t read_file_fd(int fd, char *dst, int len)
 		if (r > 0) {
 			size += r;
 			len -= r;
-		}
+		} else
+			return size;
 	} while (len > 0);
 
 	return size;
@@ -141,7 +142,8 @@ static ssize_t write_file_fd(int fd, char *src, size_t len)
 		if (r > 0) {
 			size += r;
 			len -= r;
-		}
+		} else
+			return size;
 	} while (len > 0);
 
 	return size;
-- 
2.7.4




More information about the minicoredumper mailing list