summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/test-bus-memfd.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-01-22 13:06:04 +0100
committerLennart Poettering <lennart@poettering.net>2014-01-22 13:06:04 +0100
commit7f96b1d8147b164bc7c8ce119aeea5fed6ceecb7 (patch)
tree177dd946f66e5a4c9e0ebfe4b5b3456a5e7679cc /src/libsystemd/sd-bus/test-bus-memfd.c
parent3736955368e8a3a24962f5fdd25cce3281885c30 (diff)
bus: extend memfd api so that we can label memfds for debugging purposes
Diffstat (limited to 'src/libsystemd/sd-bus/test-bus-memfd.c')
-rw-r--r--src/libsystemd/sd-bus/test-bus-memfd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/test-bus-memfd.c b/src/libsystemd/sd-bus/test-bus-memfd.c
index b9d6a250c3..f7197ed096 100644
--- a/src/libsystemd/sd-bus/test-bus-memfd.c
+++ b/src/libsystemd/sd-bus/test-bus-memfd.c
@@ -30,7 +30,7 @@
int main(int argc, char *argv[]) {
sd_memfd *m;
- char *s;
+ char *s, *name;
uint64_t sz;
int r, fd;
FILE *f;
@@ -40,10 +40,16 @@ int main(int argc, char *argv[]) {
log_set_max_level(LOG_DEBUG);
- r = sd_memfd_new(&m);
+ r = sd_memfd_new(NULL, &m);
if (r == -ENOENT)
return EXIT_TEST_SKIP;
+ assert_se(r >= 0);
+
+ assert_se(sd_memfd_get_name(m, &name) >= 0);
+ log_info("name: %s", name);
+ free(name);
+
r = sd_memfd_map(m, 0, 12, (void**) &s);
assert_se(r >= 0);