mirror of
https://github.com/systemd/systemd.git
synced 2024-12-26 03:22:00 +03:00
macro: interpret arguments to IOVEC_SET_STRING only once
This commit is contained in:
parent
e3d1855bb9
commit
bff7c062a4
8
macro.h
8
macro.h
@ -117,10 +117,12 @@ static inline size_t ALIGN(size_t l) {
|
|||||||
|
|
||||||
#define char_array_0(x) x[sizeof(x)-1] = 0;
|
#define char_array_0(x) x[sizeof(x)-1] = 0;
|
||||||
|
|
||||||
#define IOVEC_SET_STRING(iovec, s) \
|
#define IOVEC_SET_STRING(i, s) \
|
||||||
do { \
|
do { \
|
||||||
(iovec).iov_base = s; \
|
struct iovec *_i = &(i); \
|
||||||
(iovec).iov_len = strlen(s); \
|
char *_s = (char *)(s); \
|
||||||
|
_i->iov_base = _s; \
|
||||||
|
_i->iov_len = strlen(_s); \
|
||||||
} while(false);
|
} while(false);
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user