use new API
[util-vserver.git] / util-vserver / tests / chrootsafe.cc
index eac461d..18ba38e 100644 (file)
 
        chrootsafe /vservers/test
 */
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+#include "compat.h"
+
 #include <stdio.h>
 #include <string.h>
 #include <fcntl.h>
@@ -39,7 +44,7 @@ int main (int argc, char *argv[])
        // This test must fail
        int fd = open ("/",O_RDONLY);
        if (fd != -1){
-               if (call_chrootsafe(argv[1])==-1){
+               if (vc_chrootsafe(argv[1])==-1){
                        fprintf (stderr,"Ok, chrootsafe failed with one open directory errno=%s\n",strerror(errno));
                }else{
                        fprintf (stderr,"Hum, chrootsafe succeed with one open directory\n");
@@ -48,7 +53,7 @@ int main (int argc, char *argv[])
                close (fd);
        }
        // Now it should work
-       if (call_chrootsafe(argv[1])!=-1){
+       if (vc_chrootsafe(argv[1])!=-1){
                fprintf (stderr,"Ok, chrootsafe worked\n");
                system ("/bin/sh");
        }else{