Commit 02cd3e04 authored by Filip Roséen's avatar Filip Roséen Committed by Jean-Baptiste Kempf

misc/interrupt: use designated initializers for struct iovec

Given that POSIX does not guarantee the order (nor the number) of the
data-members within "struct iovec", we should either use designated
initializers, or direct member-access, to initialize struct iovec.{iov_base,
iov_len}.

As designated-initialiazers are used in other parts of src/misc/interrupt.c,
this patch does the same.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent d4c955a6
......@@ -514,7 +514,7 @@ ssize_t vlc_writev_i11e(int fd, const struct iovec *iov, int count)
*/
ssize_t vlc_read_i11e(int fd, void *buf, size_t count)
{
struct iovec iov = { buf, count };
struct iovec iov = { .iov_base = buf, .iov_len = count };
return vlc_readv_i11e(fd, &iov, 1);
}
......@@ -527,7 +527,7 @@ ssize_t vlc_read_i11e(int fd, void *buf, size_t count)
*/
ssize_t vlc_write_i11e(int fd, const void *buf, size_t count)
{
struct iovec iov = { (void *)buf, count };
struct iovec iov = { .iov_base = (void*)buf, .iov_len = count };
return vlc_writev_i11e(fd, &iov, 1);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment