X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Ftests%2Fgetctx.c;h=0a7b492021a0cb8f0ee84eda216b5ed61eafac7f;hb=3eb1b2279739d0f16391a3724a9897c686f030d3;hp=e19281854829a46c5cf1716f5e0e68a1c862aefd;hpb=604c7e22a69f1e6c2e206304ef01b15bc8ab0774;p=util-vserver.git diff --git a/util-vserver/tests/getctx.c b/util-vserver/tests/getctx.c index e192818..0a7b492 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_get_task_xid(0); + else ctx = vc_get_task_xid(atoi(argv[1])); + + utilvserver_fmt_int(buf, ctx); + + WRITE_STR(1, buf); + WRITE_MSG(1, "\n"); return 0; }