diff options
Diffstat (limited to 'lib/ipc/tc.c')
| -rw-r--r-- | lib/ipc/tc.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/ipc/tc.c b/lib/ipc/tc.c index fb799bba94b7..e366f1789559 100644 --- a/lib/ipc/tc.c +++ b/lib/ipc/tc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009 Kungliga Tekniska Högskolan + * Copyright (c) 2009 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,6 +33,7 @@ * SUCH DAMAGE. */ +#include "config.h" #include <stdio.h> #include <stdlib.h> #include <krb5-types.h> @@ -62,7 +63,9 @@ usage(int ret) static void reply(void *ctx, int errorcode, heim_idata *rep, heim_icred cred) { - printf("got reply\n"); + printf("got reply errorcode %d, rep %.*s\n", errorcode, + rep->length < INT_MAX ? (int)rep->length : INT_MAX, + (char *)rep->data); heim_ipc_semaphore_signal((heim_isemaphore)ctx); /* tell caller we are done */ } @@ -73,13 +76,18 @@ test_ipc(const char *service) heim_idata req, rep; heim_ipc ipc; int ret; + char buf[128]; + + snprintf(buf, sizeof(buf), "testing heim IPC via %s", service); + + printf("%s\n", buf); ret = heim_ipc_init_context(service, &ipc); if (ret) errx(1, "heim_ipc_init_context: %d", ret); - req.length = 0; - req.data = NULL; + req.length = strlen(buf); + req.data = buf; ret = heim_ipc_call(ipc, &req, &rep, NULL); if (ret) @@ -122,6 +130,9 @@ main(int argc, char **argv) #endif test_ipc("ANY:org.h5l.test-ipc"); test_ipc("UNIX:org.h5l.test-ipc"); +#ifdef HAVE_DOOR_CREATE + test_ipc("DOOR:org.h5l.test-ipc"); +#endif return 0; } |
