summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bbe5133)
raw | patch | inline | side by side (parent: bbe5133)
author | Pavel Rochnyack <pavel2000@ngs.ru> | |
Mon, 31 Jul 2017 05:13:15 +0000 (12:13 +0700) | ||
committer | Pavel Rochnyack <pavel2000@ngs.ru> | |
Wed, 11 Oct 2017 07:33:10 +0000 (14:33 +0700) |
Functions 'sread()' and 'swrite()', unlike 'read()' and 'write()', does not return the number of bytes actually read/written.
They return error status, which is returned as 'int' type in Collectd code.
They return error status, which is returned as 'int' type in Collectd code.
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 28c9798db2d7fdd638b98824a57adf8ba80ea50c..cf981dc0a3d8b03b0022bf997f430115e7d4cc47 100644 (file)
--- a/src/daemon/common.c
+++ b/src/daemon/common.c
}
#endif
-ssize_t sread(int fd, void *buf, size_t count) {
+int sread(int fd, void *buf, size_t count) {
char *ptr;
size_t nleft;
ssize_t status;
return 0;
}
-ssize_t swrite(int fd, const void *buf, size_t count) {
+int swrite(int fd, const void *buf, size_t count) {
const char *ptr;
size_t nleft;
ssize_t status;
diff --git a/src/daemon/common.h b/src/daemon/common.h
index 59e99ec4fdc6fefb5f1f8f63d09b71034e0aa0ee..7f8605215b7f5de425721bba2e8a482b352ee5ce 100644 (file)
--- a/src/daemon/common.h
+++ b/src/daemon/common.h
* Zero upon success or non-zero if an error occurred. `errno' is set in this
* case.
*/
-ssize_t sread(int fd, void *buf, size_t count);
+int sread(int fd, void *buf, size_t count);
/*
* NAME
* Zero upon success or non-zero if an error occurred. `errno' is set in this
* case.
*/
-ssize_t swrite(int fd, const void *buf, size_t count);
+int swrite(int fd, const void *buf, size_t count);
/*
* NAME