Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151042991
D55800.id173527.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D55800.id173527.diff
View Options
diff --git a/usr.sbin/bhyve/iov.h b/usr.sbin/bhyve/iov.h
--- a/usr.sbin/bhyve/iov.h
+++ b/usr.sbin/bhyve/iov.h
@@ -40,7 +40,7 @@
struct iovec *split_iov(struct iovec *, size_t *, size_t, size_t *);
size_t count_iov(const struct iovec *, size_t);
bool check_iov_len(const struct iovec *, size_t, size_t);
-ssize_t iov_to_buf(const struct iovec *, size_t, void **);
-ssize_t buf_to_iov(const void *, size_t, const struct iovec *, size_t);
+size_t iov_to_buf(const struct iovec *, size_t, void **);
+size_t buf_to_iov(const void *, size_t, const struct iovec *, size_t);
#endif /* _IOV_H_ */
diff --git a/usr.sbin/bhyve/iov.c b/usr.sbin/bhyve/iov.c
--- a/usr.sbin/bhyve/iov.c
+++ b/usr.sbin/bhyve/iov.c
@@ -110,16 +110,16 @@
return (false);
}
-ssize_t
+size_t
iov_to_buf(const struct iovec *iov, size_t niov, void **buf)
{
size_t ptr, total;
size_t i;
total = count_iov(iov, niov);
- *buf = realloc(*buf, total);
- if (*buf == NULL)
- return (-1);
+ *buf = reallocf(*buf, total);
+ if (total == 0 || *buf == NULL)
+ return (0);
for (i = 0, ptr = 0; i < niov; i++) {
memcpy((uint8_t *)*buf + ptr, iov[i].iov_base, iov[i].iov_len);
@@ -129,7 +129,7 @@
return (total);
}
-ssize_t
+size_t
buf_to_iov(const void *buf, size_t buflen, const struct iovec *iov, size_t niov)
{
size_t off = 0, len;
@@ -141,5 +141,5 @@
off += len;
}
- return ((ssize_t)off);
+ return (off);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 6, 3:09 PM (8 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29547790
Default Alt Text
D55800.id173527.diff (1 KB)
Attached To
Mode
D55800: bhyve/virtio: Fix comparison of integer expressions of different signedness
Attached
Detach File
Event Timeline
Log In to Comment