summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0587ef9)
raw | patch | inline | side by side (parent: 0587ef9)
author | Pavel Rochnyack <pavel2000@ngs.ru> | |
Fri, 26 May 2017 06:14:19 +0000 (12:14 +0600) | ||
committer | Pavel Rochnyack <pavel2000@ngs.ru> | |
Wed, 11 Oct 2017 07:33:09 +0000 (14:33 +0700) |
The sread() function should not close fd in any cases, that is unexpected.
src/daemon/common.c | patch | blob | history | |
src/daemon/common.h | patch | blob | history |
diff --git a/src/daemon/common.c b/src/daemon/common.c
index 6c856a6b0c7ea6fbdc543974979601e9e070c8bf..28c9798db2d7fdd638b98824a57adf8ba80ea50c 100644 (file)
--- a/src/daemon/common.c
+++ b/src/daemon/common.c
return status;
if (status == 0) {
- DEBUG("Received EOF from fd %i. "
- "Closing fd and returning error.",
- fd);
- close(fd);
+ DEBUG("Received EOF from fd %i. ", fd);
return -1;
}
diff --git a/src/daemon/common.h b/src/daemon/common.h
index afd292a3d9b5a31bc91200b59694eb57ab2aac62..59e99ec4fdc6fefb5f1f8f63d09b71034e0aa0ee 100644 (file)
--- a/src/daemon/common.h
+++ b/src/daemon/common.h
*
* DESCRIPTION
* Reads exactly `n' bytes or fails. Syntax and other behavior is analogous
- * to `read(2)'. If EOF is received the file descriptor is closed and an
- * error is returned.
+ * to `read(2)'.
*
* PARAMETERS
* `fd' File descriptor to write to.