use $(LIBENSCVECTOR) instead of libensc_vector.a
[util-vserver.git] / util-vserver / src / vrsetup.c
index 81a3e5b..b750d64 100644 (file)
 #  include <config.h>
 #endif
 
-#include "wrappers.h"
 #include "util.h"
 
 #include <getopt.h>
 #include <stdlib.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+
+#define ENSC_WRAPPERS_FCNTL    1
+#define ENSC_WRAPPERS_IOCTL    1
+#define ENSC_WRAPPERS_UNISTD   1
+#include <wrappers.h>
 
 int wrapper_exit_code = 1;
 
@@ -62,7 +68,7 @@ showVersion()
   WRITE_MSG(1,
            "vrsetup " VERSION " -- set up and control vroot devices\n"
            "This program is part of " PACKAGE_STRING "\n\n"
-           "Copyright (C) 2003 Enrico Scholz\n"
+           "Copyright (C) 2004 Enrico Scholz\n"
            VERSION_COPYRIGHT_DISCLAIMER);
   exit(0);
 }
@@ -112,12 +118,12 @@ int main(int argc, char *argv[])
   root_device = argv[optind];
   if (do_setup) real_root_device = argv[optind+1];
 
-  fd = Eopen(root_device, O_RDONLY, 0);
+  fd = EopenD(root_device, O_RDONLY, 0);
   if      (do_increment) Eioctl(fd, VROOT_INC_USE, 0);
   else if (do_decrement) Eioctl(fd, VROOT_DEC_USE, 0);
   else if (do_delete)    Eioctl(fd, VROOT_CLR_DEV, 0);
   else {
-    int                dfd = Eopen(real_root_device, O_RDONLY, 0);
+    int                dfd = EopenD(real_root_device, O_RDONLY, 0);
     Eioctl(fd, VROOT_SET_DEV, (void*)dfd);
     Eclose(dfd);
   }