diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-03-06 01:25:14 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-03-06 01:30:28 +0100 |
commit | ce16d177ddaa6b9fe1f4a40243185bf18ac1915e (patch) | |
tree | cc0b0f3c334f5944f6089fd06b883869e7db3a03 /src/test/test-socket-util.c | |
parent | sd-journal: wrap long line (diff) | |
download | systemd-ce16d177ddaa6b9fe1f4a40243185bf18ac1915e.tar.xz systemd-ce16d177ddaa6b9fe1f4a40243185bf18ac1915e.zip |
tree-wide: replace IOVEC_INIT with IOVEC_MAKE
We use gnu11 to build, hence we can use structured initializer with
casting, and it is not necessary to use different patterns on
initialization and assignment.
Addresses https://github.com/systemd/systemd/pull/26560#discussion_r1118875447.
Diffstat (limited to 'src/test/test-socket-util.c')
-rw-r--r-- | src/test/test-socket-util.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/test-socket-util.c b/src/test/test-socket-util.c index dbafe8b058..71ec766ca1 100644 --- a/src/test/test-socket-util.c +++ b/src/test/test-socket-util.c @@ -248,7 +248,7 @@ TEST(passfd_read) { /* Parent */ char buf[64]; - struct iovec iov = IOVEC_INIT(buf, sizeof(buf)-1); + struct iovec iov = IOVEC_MAKE(buf, sizeof(buf)-1); _cleanup_close_ int fd; pair[1] = safe_close(pair[1]); @@ -275,7 +275,7 @@ TEST(passfd_contents_read) { if (r == 0) { /* Child */ - struct iovec iov = IOVEC_INIT_STRING(wire_contents); + struct iovec iov = IOVEC_MAKE_STRING(wire_contents); char tmpfile[] = "/tmp/test-socket-util-passfd-contents-read-XXXXXX"; pair[0] = safe_close(pair[0]); @@ -292,7 +292,7 @@ TEST(passfd_contents_read) { /* Parent */ char buf[64]; - struct iovec iov = IOVEC_INIT(buf, sizeof(buf)-1); + struct iovec iov = IOVEC_MAKE(buf, sizeof(buf)-1); _cleanup_close_ int fd; ssize_t k; @@ -322,7 +322,7 @@ TEST(receive_nopassfd) { if (r == 0) { /* Child */ - struct iovec iov = IOVEC_INIT_STRING(wire_contents); + struct iovec iov = IOVEC_MAKE_STRING(wire_contents); pair[0] = safe_close(pair[0]); @@ -332,7 +332,7 @@ TEST(receive_nopassfd) { /* Parent */ char buf[64]; - struct iovec iov = IOVEC_INIT(buf, sizeof(buf)-1); + struct iovec iov = IOVEC_MAKE(buf, sizeof(buf)-1); int fd = -999; ssize_t k; @@ -366,7 +366,7 @@ TEST(send_nodata_nofd) { /* Parent */ char buf[64]; - struct iovec iov = IOVEC_INIT(buf, sizeof(buf)-1); + struct iovec iov = IOVEC_MAKE(buf, sizeof(buf)-1); int fd = -999; ssize_t k; @@ -391,7 +391,7 @@ TEST(send_emptydata) { if (r == 0) { /* Child */ - struct iovec iov = IOVEC_INIT_STRING(""); /* zero-length iov */ + struct iovec iov = IOVEC_MAKE_STRING(""); /* zero-length iov */ assert_se(iov.iov_len == 0); pair[0] = safe_close(pair[0]); @@ -403,7 +403,7 @@ TEST(send_emptydata) { /* Parent */ char buf[64]; - struct iovec iov = IOVEC_INIT(buf, sizeof(buf)-1); + struct iovec iov = IOVEC_MAKE(buf, sizeof(buf)-1); int fd = -999; ssize_t k; |