mirror of
https://github.com/systemd/systemd
synced 2024-10-15 20:45:09 +00:00
basic/iovec-util: drop IOVEC_NULL
The macro isn't very useful, we can just use the direct setting to increase readability.
This commit is contained in:
parent
1ca0b482b6
commit
7dc951ef91
|
@ -12,8 +12,6 @@ size_t iovec_total_size(const struct iovec *iovec, size_t n);
|
|||
|
||||
bool iovec_increment(struct iovec *iovec, size_t n, size_t k);
|
||||
|
||||
#define IOVEC_NULL (const struct iovec) {}
|
||||
|
||||
#define IOVEC_MAKE(base, len) (struct iovec) { .iov_base = (base), .iov_len = (len) }
|
||||
#define IOVEC_MAKE_STRING(string) \
|
||||
({ \
|
||||
|
@ -21,7 +19,7 @@ bool iovec_increment(struct iovec *iovec, size_t n, size_t k);
|
|||
IOVEC_MAKE((char*) _s, strlen(_s)); \
|
||||
})
|
||||
|
||||
#define TAKE_IOVEC(p) TAKE_GENERIC((p), struct iovec, IOVEC_NULL)
|
||||
#define TAKE_IOVEC(p) TAKE_GENERIC((p), struct iovec, {})
|
||||
|
||||
static inline void iovec_done(struct iovec *iovec) {
|
||||
/* A _cleanup_() helper that frees the iov_base in the iovec */
|
||||
|
|
|
@ -530,7 +530,7 @@ _public_ int sd_journal_send_with_location(const char *file, const char *line, c
|
|||
|
||||
r = sd_journal_sendv(iov, n_iov);
|
||||
|
||||
iov[0] = iov[1] = iov[2] = IOVEC_NULL;
|
||||
iov[0] = iov[1] = iov[2] = (struct iovec) {};
|
||||
|
||||
return r;
|
||||
}
|
||||
|
|
|
@ -4139,7 +4139,7 @@ static int sign_verity_roothash(
|
|||
|
||||
static int partition_format_verity_sig(Context *context, Partition *p) {
|
||||
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
|
||||
_cleanup_(iovec_done) struct iovec sig = IOVEC_NULL;
|
||||
_cleanup_(iovec_done) struct iovec sig = {};
|
||||
_cleanup_free_ char *text = NULL, *hint = NULL;
|
||||
Partition *hp;
|
||||
uint8_t fp[X509_FINGERPRINT_SIZE];
|
||||
|
|
Loading…
Reference in a new issue