X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Ftests%2Fgetctx.c;h=15657c34df9c5595c5ef392623ba4b4528c36341;hb=b38d70e7594b43cdd63b9e27ea5783001ef8407c;hp=e19281854829a46c5cf1716f5e0e68a1c862aefd;hpb=604c7e22a69f1e6c2e206304ef01b15bc8ab0774;p=util-vserver.git diff --git a/util-vserver/tests/getctx.c b/util-vserver/tests/getctx.c index e192818..15657c3 100644 --- a/util-vserver/tests/getctx.c +++ b/util-vserver/tests/getctx.c @@ -22,14 +22,24 @@ #include "compat.h" #include "vserver.h" +#include "internal.h" +#include "src/util.h" -#include #include +#include int main(int argc, char *argv[]) { - if (argc==1) printf("%i\n", getcctx()); - else printf("%i\n", getctx(atoi(argv[1]))); + char buf[sizeof(int)*3+2]; + xid_t ctx; + + if (argc==1) ctx = vc_X_getctx(0); + else ctx = vc_X_getctx(atoi(argv[1])); + + utilvserver_fmt_int(buf, ctx); + + WRITE_STR(1, buf); + WRITE_MSG(1, "\n"); return 0; }