mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 14:40:31 +00:00
iovec-wrapper: reintroduce iovw_free() and iovw_free_free()
They were dropped by the commit 267b16f33c,
but will be used later. Hence, let's reintroduce them.
This commit is contained in:
@@ -24,6 +24,22 @@ void iovw_done_free(struct iovec_wrapper *iovw) {
|
||||
iovw_done(iovw);
|
||||
}
|
||||
|
||||
struct iovec_wrapper* iovw_free(struct iovec_wrapper *iovw) {
|
||||
if (!iovw)
|
||||
return NULL;
|
||||
|
||||
iovw_done(iovw);
|
||||
return mfree(iovw);
|
||||
}
|
||||
|
||||
struct iovec_wrapper* iovw_free_free(struct iovec_wrapper *iovw) {
|
||||
if (!iovw)
|
||||
return NULL;
|
||||
|
||||
iovw_done_free(iovw);
|
||||
return mfree(iovw);
|
||||
}
|
||||
|
||||
int iovw_compare(const struct iovec_wrapper *a, const struct iovec_wrapper *b) {
|
||||
int r;
|
||||
|
||||
|
||||
@@ -11,6 +11,12 @@ struct iovec_wrapper {
|
||||
void iovw_done_free(struct iovec_wrapper *iovw);
|
||||
void iovw_done(struct iovec_wrapper *iovw);
|
||||
|
||||
struct iovec_wrapper* iovw_free(struct iovec_wrapper *iovw);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(struct iovec_wrapper*, iovw_free);
|
||||
|
||||
struct iovec_wrapper* iovw_free_free(struct iovec_wrapper *iovw);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(struct iovec_wrapper*, iovw_free_free);
|
||||
|
||||
int iovw_compare(const struct iovec_wrapper *a, const struct iovec_wrapper *b) _pure_;
|
||||
static inline bool iovw_equal(const struct iovec_wrapper *a, const struct iovec_wrapper *b) {
|
||||
return iovw_compare(a, b) == 0;
|
||||
|
||||
Reference in New Issue
Block a user