From 4531a9bc206c0c22e29b56ac4a7528afba2e9c83 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 19 Aug 2014 19:39:16 +0200 Subject: memfd: simplify API Now, that the memfd stuff is not exported anymore, we can simplify a few things: Use assert() instead of assert_return(), since this is used internally only, and we should be less permissive then. No need to pass an allocated fd back by call-by-reference, we can just directly return it. --- src/libsystemd/sd-bus/test-bus-zero-copy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libsystemd/sd-bus') diff --git a/src/libsystemd/sd-bus/test-bus-zero-copy.c b/src/libsystemd/sd-bus/test-bus-zero-copy.c index 1d279e6032..e3010fbf7e 100644 --- a/src/libsystemd/sd-bus/test-bus-zero-copy.c +++ b/src/libsystemd/sd-bus/test-bus-zero-copy.c @@ -93,8 +93,8 @@ int main(int argc, char *argv[]) { memset(p+1, 'L', FIRST_ARRAY-2); p[FIRST_ARRAY-1] = '>'; - r = memfd_new_and_map(&f, NULL, STRING_SIZE, (void**) &s); - assert_se(r >= 0); + f = memfd_new_and_map(NULL, STRING_SIZE, (void**) &s); + assert_se(f >= 0); s[0] = '<'; for (i = 1; i < STRING_SIZE-2; i++) @@ -112,8 +112,8 @@ int main(int argc, char *argv[]) { close(f); - r = memfd_new_and_map(&f, NULL, SECOND_ARRAY, (void**) &p); - assert_se(r >= 0); + f = memfd_new_and_map(NULL, SECOND_ARRAY, (void**) &p); + assert_se(f >= 0); p[0] = '<'; memset(p+1, 'P', SECOND_ARRAY-2); -- cgit v1.2.3-54-g00ecf