提交 dbab6bb5 编写于 作者: E Eric Blake

util: fix saferead type

* src/util/util.c (saferead): Fix return type.
(safewrite): Fix indentation.
上级 19240c3c
......@@ -88,7 +88,8 @@ verify(sizeof(gid_t) <= sizeof (unsigned int) &&
__FUNCTION__, __LINE__, __VA_ARGS__)
/* Like read(), but restarts after EINTR */
int saferead(int fd, void *buf, size_t count)
ssize_t
saferead(int fd, void *buf, size_t count)
{
size_t nread = 0;
while (count > 0) {
......@@ -107,7 +108,8 @@ int saferead(int fd, void *buf, size_t count)
}
/* Like write(), but restarts after EINTR */
ssize_t safewrite(int fd, const void *buf, size_t count)
ssize_t
safewrite(int fd, const void *buf, size_t count)
{
size_t nwritten = 0;
while (count > 0) {
......
......@@ -36,7 +36,7 @@
# define MIN(a, b) ((a) < (b) ? (a) : (b))
# endif
int saferead(int fd, void *buf, size_t count) ATTRIBUTE_RETURN_CHECK;
ssize_t saferead(int fd, void *buf, size_t count) ATTRIBUTE_RETURN_CHECK;
ssize_t safewrite(int fd, const void *buf, size_t count)
ATTRIBUTE_RETURN_CHECK;
int safezero(int fd, int flags, off_t offset, off_t len)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册