X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fsrc%2Fvutil.cc;h=f6e6f961cfdda5921531e5d2aa6838c38a217074;hb=a917f24ef7b003dcef54a3db2644cf9cb4bc2db2;hp=94957a33732da06a1c4555ba1632d869009c54bd;hpb=da691fd4bad5e187b307b7fd86bf5fd61e47c3fc;p=util-vserver.git diff --git a/util-vserver/src/vutil.cc b/util-vserver/src/vutil.cc index 94957a3..f6e6f96 100644 --- a/util-vserver/src/vutil.cc +++ b/util-vserver/src/vutil.cc @@ -18,6 +18,10 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma implementation +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include @@ -28,7 +32,9 @@ #include #include "vutil.h" #include -#include +#include "ext2fs.h" + +#include bool testmode; int debug; @@ -92,7 +98,7 @@ int setext2flag (const char *fname, bool set, int ext2flags) ret = ioctl (fd,EXT2_IOC_SETFLAGS,&flags); close (fd); if (ret == -1){ - fprintf (stderr,"Can't %s immutable flag on file %s (^s)\n" + fprintf (stderr,"Can't %s immutable flag on file %s (%s)\n" ,(set ? "set" : "unset") ,fname ,strerror(errno)); @@ -206,7 +212,7 @@ int vbuild_file_copy( /* Load the list of all packages in a vserver */ -void vutil_loadallpkg (string &refserver, list &packages) +void vutil_loadallpkg (Vserver const &refserver, list &packages) { FILE *fin = vutil_execdistcmd (K_PKGVERSION,refserver,NULL); if (fin != NULL){ @@ -214,7 +220,7 @@ void vutil_loadallpkg (string &refserver, list &packages) while (fgets(line,sizeof(line)-1,fin)!=NULL){ int last = strlen(line)-1; if (last >= 0 && line[last] == '\n') line[last] = '\0'; - packages.push_back (PACKAGE(line)); + packages.push_back (Package(line)); } pclose (fin); } @@ -235,10 +241,10 @@ const char K_PKGVERSION[]="pkgversion"; const char K_DUMPFILES[]="dumpfiles"; const char K_UNIFILES[]="unifiles"; -FILE *vutil_execdistcmd (const char *key, const string &vserver, const char *args) +FILE *vutil_execdistcmd (const char *key, Vserver const &vserver, const char *args) { string cmd = PKGLIBDIR "/distrib-info "; - cmd += vserver; + cmd += vserver.getConfDir(); cmd += " "; cmd += key; if (args != NULL){ @@ -262,4 +268,3 @@ FILE *vutil_execdistcmd (const char *key, const string &vserver, const char *arg } return ret; } -