mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-08 21:17:47 +03:00
tree-wide: use IOVEC_MAKE() at many places
This commit is contained in:
parent
eaf6369769
commit
5cfa2c3dc0
24
coccinelle/iovec-make.cocci
Normal file
24
coccinelle/iovec-make.cocci
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
@@
|
||||||
|
expression x, y, p, l;
|
||||||
|
@@
|
||||||
|
- x[y].iov_base = p;
|
||||||
|
- x[y].iov_len = l;
|
||||||
|
- y++;
|
||||||
|
+ x[y++] = IOVEC_MAKE(p, l);
|
||||||
|
@@
|
||||||
|
expression x, p, l;
|
||||||
|
@@
|
||||||
|
- x.iov_base = p;
|
||||||
|
- x.iov_len = l;
|
||||||
|
+ x = IOVEC_MAKE(p, l);
|
||||||
|
@@
|
||||||
|
expression x, p, l;
|
||||||
|
@@
|
||||||
|
- x->iov_base = p;
|
||||||
|
- x->iov_len = l;
|
||||||
|
+ *x = IOVEC_MAKE(p, l);
|
||||||
|
@@
|
||||||
|
expression s;
|
||||||
|
@@
|
||||||
|
- IOVEC_MAKE(s, strlen(s));
|
||||||
|
+ IOVEC_MAKE_STRING(s);
|
@ -858,8 +858,7 @@ int log_format_iovec(
|
|||||||
iovec[(*n)++] = IOVEC_MAKE_STRING(m);
|
iovec[(*n)++] = IOVEC_MAKE_STRING(m);
|
||||||
|
|
||||||
if (newline_separator) {
|
if (newline_separator) {
|
||||||
iovec[*n].iov_base = (char*) &nl;
|
iovec[*n] = IOVEC_MAKE((char *)&nl, 1);
|
||||||
iovec[*n].iov_len = 1;
|
|
||||||
(*n)++;
|
(*n)++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,8 +206,7 @@ static int server_process_entry(
|
|||||||
memcpy(k + (e - p) + 1, e + 1 + sizeof(uint64_t), l);
|
memcpy(k + (e - p) + 1, e + 1 + sizeof(uint64_t), l);
|
||||||
|
|
||||||
if (journal_field_valid(p, e - p, false)) {
|
if (journal_field_valid(p, e - p, false)) {
|
||||||
iovec[n].iov_base = k;
|
iovec[n] = IOVEC_MAKE(k, (e - p) + 1 + l);
|
||||||
iovec[n].iov_len = (e - p) + 1 + l;
|
|
||||||
entry_size += iovec[n].iov_len;
|
entry_size += iovec[n].iov_len;
|
||||||
n++;
|
n++;
|
||||||
|
|
||||||
|
@ -1266,8 +1266,7 @@ int server_process_datagram(sd_event_source *es, int fd, uint32_t revents, void
|
|||||||
if (!GREEDY_REALLOC(s->buffer, s->buffer_size, m))
|
if (!GREEDY_REALLOC(s->buffer, s->buffer_size, m))
|
||||||
return log_oom();
|
return log_oom();
|
||||||
|
|
||||||
iovec.iov_base = s->buffer;
|
iovec = IOVEC_MAKE(s->buffer, s->buffer_size - 1); /* Leave room for trailing NUL we add later */
|
||||||
iovec.iov_len = s->buffer_size - 1; /* Leave room for trailing NUL we add later */
|
|
||||||
|
|
||||||
n = recvmsg(fd, &msghdr, MSG_DONTWAIT|MSG_CMSG_CLOEXEC);
|
n = recvmsg(fd, &msghdr, MSG_DONTWAIT|MSG_CMSG_CLOEXEC);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
|
@ -6,13 +6,14 @@
|
|||||||
#include "sd-journal.h"
|
#include "sd-journal.h"
|
||||||
|
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
|
#include "io-util.h"
|
||||||
#include "journal-file.h"
|
#include "journal-file.h"
|
||||||
#include "journal-vacuum.h"
|
#include "journal-vacuum.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "parse-util.h"
|
#include "parse-util.h"
|
||||||
#include "rm-rf.h"
|
#include "rm-rf.h"
|
||||||
#include "util.h"
|
|
||||||
#include "tests.h"
|
#include "tests.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
/* This program tests skipping around in a multi-file journal. */
|
/* This program tests skipping around in a multi-file journal. */
|
||||||
|
|
||||||
@ -58,8 +59,7 @@ static void append_number(JournalFile *f, int n, uint64_t *seqnum) {
|
|||||||
previous_ts = ts;
|
previous_ts = ts;
|
||||||
|
|
||||||
assert_se(asprintf(&p, "NUMBER=%d", n) >= 0);
|
assert_se(asprintf(&p, "NUMBER=%d", n) >= 0);
|
||||||
iovec[0].iov_base = p;
|
iovec[0] = IOVEC_MAKE_STRING(p);
|
||||||
iovec[0].iov_len = strlen(p);
|
|
||||||
assert_ret(journal_file_append_entry(f, &ts, NULL, iovec, 1, seqnum, NULL, NULL));
|
assert_ret(journal_file_append_entry(f, &ts, NULL, iovec, 1, seqnum, NULL, NULL));
|
||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
|
#include "io-util.h"
|
||||||
#include "journal-file.h"
|
#include "journal-file.h"
|
||||||
#include "journal-verify.h"
|
#include "journal-verify.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
@ -83,8 +84,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
assert_se(asprintf(&test, "RANDOM=%lu", random() % RANDOM_RANGE));
|
assert_se(asprintf(&test, "RANDOM=%lu", random() % RANDOM_RANGE));
|
||||||
|
|
||||||
iovec.iov_base = (void*) test;
|
iovec = IOVEC_MAKE_STRING(test);
|
||||||
iovec.iov_len = strlen(test);
|
|
||||||
|
|
||||||
assert_se(journal_file_append_entry(f, &ts, NULL, &iovec, 1, NULL, NULL, NULL) == 0);
|
assert_se(journal_file_append_entry(f, &ts, NULL, &iovec, 1, NULL, NULL, NULL) == 0);
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "io-util.h"
|
||||||
#include "journal-authenticate.h"
|
#include "journal-authenticate.h"
|
||||||
#include "journal-file.h"
|
#include "journal-file.h"
|
||||||
#include "journal-vacuum.h"
|
#include "journal-vacuum.h"
|
||||||
@ -32,16 +33,13 @@ static void test_non_empty(void) {
|
|||||||
assert_se(dual_timestamp_get(&ts));
|
assert_se(dual_timestamp_get(&ts));
|
||||||
assert_se(sd_id128_randomize(&fake_boot_id) == 0);
|
assert_se(sd_id128_randomize(&fake_boot_id) == 0);
|
||||||
|
|
||||||
iovec.iov_base = (void*) test;
|
iovec = IOVEC_MAKE_STRING(test);
|
||||||
iovec.iov_len = strlen(test);
|
|
||||||
assert_se(journal_file_append_entry(f, &ts, NULL, &iovec, 1, NULL, NULL, NULL) == 0);
|
assert_se(journal_file_append_entry(f, &ts, NULL, &iovec, 1, NULL, NULL, NULL) == 0);
|
||||||
|
|
||||||
iovec.iov_base = (void*) test2;
|
iovec = IOVEC_MAKE_STRING(test2);
|
||||||
iovec.iov_len = strlen(test2);
|
|
||||||
assert_se(journal_file_append_entry(f, &ts, NULL, &iovec, 1, NULL, NULL, NULL) == 0);
|
assert_se(journal_file_append_entry(f, &ts, NULL, &iovec, 1, NULL, NULL, NULL) == 0);
|
||||||
|
|
||||||
iovec.iov_base = (void*) test;
|
iovec = IOVEC_MAKE_STRING(test);
|
||||||
iovec.iov_len = strlen(test);
|
|
||||||
assert_se(journal_file_append_entry(f, &ts, &fake_boot_id, &iovec, 1, NULL, NULL, NULL) == 0);
|
assert_se(journal_file_append_entry(f, &ts, &fake_boot_id, &iovec, 1, NULL, NULL, NULL) == 0);
|
||||||
|
|
||||||
#if HAVE_GCRYPT
|
#if HAVE_GCRYPT
|
||||||
@ -174,8 +172,7 @@ static bool check_compressed(uint64_t compress_threshold, uint64_t data_size) {
|
|||||||
|
|
||||||
dual_timestamp_get(&ts);
|
dual_timestamp_get(&ts);
|
||||||
|
|
||||||
iovec.iov_base = (void*) data;
|
iovec = IOVEC_MAKE(data, data_size);
|
||||||
iovec.iov_len = data_size;
|
|
||||||
assert_se(journal_file_append_entry(f, &ts, NULL, &iovec, 1, NULL, NULL, NULL) == 0);
|
assert_se(journal_file_append_entry(f, &ts, NULL, &iovec, 1, NULL, NULL, NULL) == 0);
|
||||||
|
|
||||||
#if HAVE_GCRYPT
|
#if HAVE_GCRYPT
|
||||||
|
@ -17,8 +17,9 @@
|
|||||||
|
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
#include "icmp6-util.h"
|
#include "icmp6-util.h"
|
||||||
#include "socket-util.h"
|
|
||||||
#include "in-addr-util.h"
|
#include "in-addr-util.h"
|
||||||
|
#include "io-util.h"
|
||||||
|
#include "socket-util.h"
|
||||||
|
|
||||||
#define IN6ADDR_ALL_ROUTERS_MULTICAST_INIT \
|
#define IN6ADDR_ALL_ROUTERS_MULTICAST_INIT \
|
||||||
{ { { 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
|
{ { { 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
|
||||||
@ -169,8 +170,7 @@ int icmp6_receive(int fd, void *buffer, size_t size, struct in6_addr *dst,
|
|||||||
struct cmsghdr *cmsg;
|
struct cmsghdr *cmsg;
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
|
|
||||||
iov.iov_base = buffer;
|
iov = IOVEC_MAKE(buffer, size);
|
||||||
iov.iov_len = size;
|
|
||||||
|
|
||||||
len = recvmsg(fd, &msg, MSG_DONTWAIT);
|
len = recvmsg(fd, &msg, MSG_DONTWAIT);
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
#include "sd-radv.h"
|
#include "sd-radv.h"
|
||||||
|
|
||||||
#include "macro.h"
|
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "dns-domain.h"
|
#include "dns-domain.h"
|
||||||
#include "ether-addr-util.h"
|
#include "ether-addr-util.h"
|
||||||
@ -17,12 +16,14 @@
|
|||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
#include "icmp6-util.h"
|
#include "icmp6-util.h"
|
||||||
#include "in-addr-util.h"
|
#include "in-addr-util.h"
|
||||||
|
#include "io-util.h"
|
||||||
|
#include "macro.h"
|
||||||
#include "radv-internal.h"
|
#include "radv-internal.h"
|
||||||
|
#include "random-util.h"
|
||||||
#include "socket-util.h"
|
#include "socket-util.h"
|
||||||
#include "string-util.h"
|
#include "string-util.h"
|
||||||
#include "strv.h"
|
#include "strv.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "random-util.h"
|
|
||||||
|
|
||||||
_public_ int sd_radv_new(sd_radv **ret) {
|
_public_ int sd_radv_new(sd_radv **ret) {
|
||||||
_cleanup_(sd_radv_unrefp) sd_radv *ra = NULL;
|
_cleanup_(sd_radv_unrefp) sd_radv *ra = NULL;
|
||||||
@ -159,24 +160,18 @@ static int radv_send(sd_radv *ra, const struct in6_addr *dst, uint32_t router_li
|
|||||||
adv.nd_ra_curhoplimit = ra->hop_limit;
|
adv.nd_ra_curhoplimit = ra->hop_limit;
|
||||||
adv.nd_ra_flags_reserved = ra->flags;
|
adv.nd_ra_flags_reserved = ra->flags;
|
||||||
adv.nd_ra_router_lifetime = htobe16(router_lifetime);
|
adv.nd_ra_router_lifetime = htobe16(router_lifetime);
|
||||||
iov[msg.msg_iovlen].iov_base = &adv;
|
iov[msg.msg_iovlen++] = IOVEC_MAKE(&adv, sizeof(adv));
|
||||||
iov[msg.msg_iovlen].iov_len = sizeof(adv);
|
|
||||||
msg.msg_iovlen++;
|
|
||||||
|
|
||||||
/* MAC address is optional, either because the link does not use L2
|
/* MAC address is optional, either because the link does not use L2
|
||||||
addresses or load sharing is desired. See RFC 4861, Section 4.2 */
|
addresses or load sharing is desired. See RFC 4861, Section 4.2 */
|
||||||
if (!ether_addr_is_null(&ra->mac_addr)) {
|
if (!ether_addr_is_null(&ra->mac_addr)) {
|
||||||
opt_mac.slladdr = ra->mac_addr;
|
opt_mac.slladdr = ra->mac_addr;
|
||||||
iov[msg.msg_iovlen].iov_base = &opt_mac;
|
iov[msg.msg_iovlen++] = IOVEC_MAKE(&opt_mac, sizeof(opt_mac));
|
||||||
iov[msg.msg_iovlen].iov_len = sizeof(opt_mac);
|
|
||||||
msg.msg_iovlen++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ra->mtu) {
|
if (ra->mtu) {
|
||||||
opt_mtu.nd_opt_mtu_mtu = htobe32(ra->mtu);
|
opt_mtu.nd_opt_mtu_mtu = htobe32(ra->mtu);
|
||||||
iov[msg.msg_iovlen].iov_base = &opt_mtu;
|
iov[msg.msg_iovlen++] = IOVEC_MAKE(&opt_mtu, sizeof(opt_mtu));
|
||||||
iov[msg.msg_iovlen].iov_len = sizeof(opt_mtu);
|
|
||||||
msg.msg_iovlen++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LIST_FOREACH(prefix, p, ra->prefixes) {
|
LIST_FOREACH(prefix, p, ra->prefixes) {
|
||||||
@ -192,22 +187,14 @@ static int radv_send(sd_radv *ra, const struct in6_addr *dst, uint32_t router_li
|
|||||||
else
|
else
|
||||||
p->opt.preferred_lifetime = htobe32((p->preferred_until - time_now) / USEC_PER_SEC);
|
p->opt.preferred_lifetime = htobe32((p->preferred_until - time_now) / USEC_PER_SEC);
|
||||||
}
|
}
|
||||||
iov[msg.msg_iovlen].iov_base = &p->opt;
|
iov[msg.msg_iovlen++] = IOVEC_MAKE(&p->opt, sizeof(p->opt));
|
||||||
iov[msg.msg_iovlen].iov_len = sizeof(p->opt);
|
|
||||||
msg.msg_iovlen++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ra->rdnss) {
|
if (ra->rdnss)
|
||||||
iov[msg.msg_iovlen].iov_base = ra->rdnss;
|
iov[msg.msg_iovlen++] = IOVEC_MAKE(ra->rdnss, ra->rdnss->length * 8);
|
||||||
iov[msg.msg_iovlen].iov_len = ra->rdnss->length * 8;
|
|
||||||
msg.msg_iovlen++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ra->dnssl) {
|
if (ra->dnssl)
|
||||||
iov[msg.msg_iovlen].iov_base = ra->dnssl;
|
iov[msg.msg_iovlen++] = IOVEC_MAKE(ra->dnssl, ra->dnssl->length * 8);
|
||||||
iov[msg.msg_iovlen].iov_len = ra->dnssl->length * 8;
|
|
||||||
msg.msg_iovlen++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sendmsg(ra->fd, &msg, 0) < 0)
|
if (sendmsg(ra->fd, &msg, 0) < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
@ -44,8 +44,7 @@ static void iovec_advance(struct iovec iov[], unsigned *idx, size_t size) {
|
|||||||
|
|
||||||
size -= i->iov_len;
|
size -= i->iov_len;
|
||||||
|
|
||||||
i->iov_base = NULL;
|
*i = IOVEC_MAKE(NULL, 0);
|
||||||
i->iov_len = 0;
|
|
||||||
|
|
||||||
(*idx)++;
|
(*idx)++;
|
||||||
}
|
}
|
||||||
@ -56,9 +55,7 @@ static int append_iovec(sd_bus_message *m, const void *p, size_t sz) {
|
|||||||
assert(p);
|
assert(p);
|
||||||
assert(sz > 0);
|
assert(sz > 0);
|
||||||
|
|
||||||
m->iovec[m->n_iovec].iov_base = (void*) p;
|
m->iovec[m->n_iovec++] = IOVEC_MAKE((void*) p, sz);
|
||||||
m->iovec[m->n_iovec].iov_len = sz;
|
|
||||||
m->n_iovec++;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -516,8 +513,7 @@ static int bus_socket_read_auth(sd_bus *b) {
|
|||||||
|
|
||||||
b->rbuffer = p;
|
b->rbuffer = p;
|
||||||
|
|
||||||
iov.iov_base = (uint8_t*) b->rbuffer + b->rbuffer_size;
|
iov = IOVEC_MAKE((uint8_t *)b->rbuffer + b->rbuffer_size, n - b->rbuffer_size);
|
||||||
iov.iov_len = n - b->rbuffer_size;
|
|
||||||
|
|
||||||
if (b->prefer_readv)
|
if (b->prefer_readv)
|
||||||
k = readv(b->input_fd, &iov, 1);
|
k = readv(b->input_fd, &iov, 1);
|
||||||
@ -634,12 +630,9 @@ static int bus_socket_start_auth_client(sd_bus *b) {
|
|||||||
else
|
else
|
||||||
auth_suffix = "\r\nBEGIN\r\n";
|
auth_suffix = "\r\nBEGIN\r\n";
|
||||||
|
|
||||||
b->auth_iovec[0].iov_base = (void*) auth_prefix;
|
b->auth_iovec[0] = IOVEC_MAKE((void*) auth_prefix, 1 + strlen(auth_prefix + 1));
|
||||||
b->auth_iovec[0].iov_len = 1 + strlen(auth_prefix + 1);
|
b->auth_iovec[1] = IOVEC_MAKE(b->auth_buffer, l * 2);
|
||||||
b->auth_iovec[1].iov_base = (void*) b->auth_buffer;
|
b->auth_iovec[2] = IOVEC_MAKE_STRING(auth_suffix);
|
||||||
b->auth_iovec[1].iov_len = l * 2;
|
|
||||||
b->auth_iovec[2].iov_base = (void*) auth_suffix;
|
|
||||||
b->auth_iovec[2].iov_len = strlen(auth_suffix);
|
|
||||||
|
|
||||||
return bus_socket_write_auth(b);
|
return bus_socket_write_auth(b);
|
||||||
}
|
}
|
||||||
@ -1146,8 +1139,7 @@ int bus_socket_read_message(sd_bus *bus) {
|
|||||||
|
|
||||||
bus->rbuffer = b;
|
bus->rbuffer = b;
|
||||||
|
|
||||||
iov.iov_base = (uint8_t*) bus->rbuffer + bus->rbuffer_size;
|
iov = IOVEC_MAKE((uint8_t *)bus->rbuffer + bus->rbuffer_size, need - bus->rbuffer_size);
|
||||||
iov.iov_len = need - bus->rbuffer_size;
|
|
||||||
|
|
||||||
if (bus->prefer_readv)
|
if (bus->prefer_readv)
|
||||||
k = readv(bus->input_fd, &iov, 1);
|
k = readv(bus->input_fd, &iov, 1);
|
||||||
|
@ -310,10 +310,8 @@ static int on_stream_io(sd_event_source *es, int fd, uint32_t revents, void *use
|
|||||||
struct iovec iov[2];
|
struct iovec iov[2];
|
||||||
ssize_t ss;
|
ssize_t ss;
|
||||||
|
|
||||||
iov[0].iov_base = &s->write_size;
|
iov[0] = IOVEC_MAKE(&s->write_size, sizeof(s->write_size));
|
||||||
iov[0].iov_len = sizeof(s->write_size);
|
iov[1] = IOVEC_MAKE(DNS_PACKET_DATA(s->write_packet), s->write_packet->size);
|
||||||
iov[1].iov_base = DNS_PACKET_DATA(s->write_packet);
|
|
||||||
iov[1].iov_len = s->write_packet->size;
|
|
||||||
|
|
||||||
IOVEC_INCREMENT(iov, 2, s->n_written);
|
IOVEC_INCREMENT(iov, 2, s->n_written);
|
||||||
|
|
||||||
|
@ -23,8 +23,8 @@ static int dnstls_flush_write_buffer(DnsStream *stream) {
|
|||||||
assert(stream->dnstls_data.write_buffer->data);
|
assert(stream->dnstls_data.write_buffer->data);
|
||||||
|
|
||||||
struct iovec iov[1];
|
struct iovec iov[1];
|
||||||
iov[0].iov_base = stream->dnstls_data.write_buffer->data;
|
iov[0] = IOVEC_MAKE(stream->dnstls_data.write_buffer->data,
|
||||||
iov[0].iov_len = stream->dnstls_data.write_buffer->length;
|
stream->dnstls_data.write_buffer->length);
|
||||||
ss = dns_stream_writev(stream, iov, 1, DNS_STREAM_WRITE_TLS_DATA);
|
ss = dns_stream_writev(stream, iov, 1, DNS_STREAM_WRITE_TLS_DATA);
|
||||||
if (ss < 0) {
|
if (ss < 0) {
|
||||||
if (ss == -EAGAIN)
|
if (ss == -EAGAIN)
|
||||||
|
@ -698,9 +698,7 @@ int ask_password_agent(
|
|||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
zero(iovec);
|
iovec = IOVEC_MAKE(passphrase, sizeof(passphrase));
|
||||||
iovec.iov_base = passphrase;
|
|
||||||
iovec.iov_len = sizeof(passphrase);
|
|
||||||
|
|
||||||
zero(control);
|
zero(control);
|
||||||
zero(msghdr);
|
zero(msghdr);
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
#include "format-util.h"
|
#include "format-util.h"
|
||||||
|
#include "io-util.h"
|
||||||
#include "socket-util.h"
|
#include "socket-util.h"
|
||||||
#include "strxcpyx.h"
|
#include "strxcpyx.h"
|
||||||
#include "udev-ctrl.h"
|
#include "udev-ctrl.h"
|
||||||
@ -344,8 +345,7 @@ struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
iov.iov_base = &uctrl_msg->ctrl_msg_wire;
|
iov = IOVEC_MAKE(&uctrl_msg->ctrl_msg_wire, sizeof(struct udev_ctrl_msg_wire));
|
||||||
iov.iov_len = sizeof(struct udev_ctrl_msg_wire);
|
|
||||||
|
|
||||||
size = recvmsg(conn->sock, &smsg, 0);
|
size = recvmsg(conn->sock, &smsg, 0);
|
||||||
if (size < 0) {
|
if (size < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user