diff options
author | Petr Štetiar <ynezz@true.cz> | 2019-12-11 10:07:08 +0100 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2019-12-16 23:39:16 +0100 |
commit | 5d7ca8309d0a1614d829df9ecd72553bcd6b5ec6 (patch) | |
tree | eeed2150756cf5f551d7a4b28e861ffa31139c0b | |
parent | d61282db56404bae71515d207b878a445854624a (diff) | |
download | ubus-5d7ca8309d0a1614d829df9ecd72553bcd6b5ec6.tar.gz |
ubusd/libubus-io: fix variable sized struct position warning
Fixes following clang-9 compiler warnings:
ubusd.c:99:18: error: field 'h' with variable sized type 'struct cmsghdr' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
struct cmsghdr h;
^
Signed-off-by: Petr Štetiar <ynezz@true.cz>
-rw-r--r-- | libubus-io.c | 4 | ||||
-rw-r--r-- | ubusd.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libubus-io.c b/libubus-io.c index 228af5c..cdd1e6e 100644 --- a/libubus-io.c +++ b/libubus-io.c @@ -60,8 +60,8 @@ static void wait_data(int fd, bool write) static int writev_retry(int fd, struct iovec *iov, int iov_len, int sock_fd) { static struct { - struct cmsghdr h; int fd; + struct cmsghdr h; } fd_buf = { .h = { .cmsg_len = sizeof(fd_buf), @@ -159,8 +159,8 @@ static int recv_retry(struct ubus_context *ctx, struct iovec *iov, bool wait, in int bytes, total = 0; int fd = ctx->sock.fd; static struct { - struct cmsghdr h; int fd; + struct cmsghdr h; } fd_buf = { .h = { .cmsg_type = SCM_RIGHTS, @@ -96,8 +96,8 @@ static int ubus_msg_writev(int fd, struct ubus_msg_buf *ub, int offset) { static struct iovec iov[2]; static struct { - struct cmsghdr h; int fd; + struct cmsghdr h; } fd_buf = { .h = { .cmsg_len = sizeof(fd_buf), @@ -216,8 +216,8 @@ static void client_cb(struct uloop_fd *sock, unsigned int events) struct ubus_msg_buf *ub; static struct iovec iov; static struct { - struct cmsghdr h; int fd; + struct cmsghdr h; } fd_buf = { .h = { .cmsg_type = SCM_RIGHTS, |