Changeset 348
- Timestamp:
- 09/04/06 17:35:49 (2 years ago)
- Files:
-
- branches/1.0.4/README (modified) (1 diff)
- branches/1.0.4/scripts/lib/vps.sh (modified) (2 diffs)
- branches/1.0.4/src/libinternal/Makefile.am (modified) (1 diff)
- branches/1.0.4/src/libinternal/bcaps-list.c (modified) (1 diff)
- branches/1.0.4/src/libinternal/ccaps-list.c (modified) (2 diffs)
- branches/1.0.4/src/libinternal/cflags-list.c (modified) (2 diffs)
- branches/1.0.4/src/libinternal/iattr-list.c (modified) (2 diffs)
- branches/1.0.4/src/libinternal/mflags-list.c (modified) (1 diff)
- branches/1.0.4/src/libinternal/nflags-list.c (modified) (1 diff)
- branches/1.0.4/src/libinternal/printf.c (deleted)
- branches/1.0.4/src/libinternal/printf.h (deleted)
- branches/1.0.4/src/libinternal/rlimit-list.c (modified) (2 diffs)
- branches/1.0.4/src/libinternal/sched-list.c (modified) (1 diff)
- branches/1.0.4/src/libinternal/sys.h (deleted)
- branches/1.0.4/src/libinternal/sys_clone.c (deleted)
- branches/1.0.4/src/libvconfig/main.c (modified) (2 diffs)
- branches/1.0.4/src/libvconfig/single.c (modified) (7 diffs)
- branches/1.0.4/src/tools/Makefile.am (modified) (1 diff)
- branches/1.0.4/src/tools/cowcp.c (modified) (11 diffs)
- branches/1.0.4/src/tools/lockfile.c (modified) (3 diffs)
- branches/1.0.4/src/tools/nidof.c (modified) (2 diffs)
- branches/1.0.4/src/tools/tools.h (modified) (4 diffs)
- branches/1.0.4/src/tools/vattr.c (modified) (10 diffs)
- branches/1.0.4/src/tools/vconfig.c (modified) (7 diffs)
- branches/1.0.4/src/tools/vcontext.c (modified) (4 diffs)
- branches/1.0.4/src/tools/vdlimit.c (modified) (3 diffs)
- branches/1.0.4/src/tools/vexec.c (modified) (4 diffs)
- branches/1.0.4/src/tools/vflags.c (modified) (9 diffs)
- branches/1.0.4/src/tools/vinfo.c (modified) (3 diffs)
- branches/1.0.4/src/tools/vkill.c (modified) (2 diffs)
- branches/1.0.4/src/tools/vlimit.c (modified) (3 diffs)
- branches/1.0.4/src/tools/vlogin.c (modified) (3 diffs)
- branches/1.0.4/src/tools/vmount.c (modified) (5 diffs)
- branches/1.0.4/src/tools/vnamespace.c (modified) (8 diffs)
- branches/1.0.4/src/tools/vncontext.c (modified) (3 diffs)
- branches/1.0.4/src/tools/vnflags.c (modified) (4 diffs)
- branches/1.0.4/src/tools/vps.c (modified) (6 diffs)
- branches/1.0.4/src/tools/vrsetup.c (modified) (2 diffs)
- branches/1.0.4/src/tools/vsched.c (modified) (3 diffs)
- branches/1.0.4/src/tools/vuname.c (modified) (3 diffs)
- branches/1.0.4/src/tools/vunify.c (modified) (17 diffs)
- branches/1.0.4/src/tools/vwait.c (modified) (4 diffs)
- branches/1.0.4/src/tools/xidof.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0.4/README
r12 r348 1 1 See http://dev.croup.de/proj/vserver-utils for details 2 3 Dependencies: 4 lucid 5 libvserver 6 libowfat branches/1.0.4/scripts/lib/vps.sh
r314 r348 105 105 [ ! -z "${VX_CCAPS}" ] && VCTX_ARGS="${VCTX_ARGS} -c $(util.array_to_list ${VX_CCAPS[@]})" 106 106 if [ ! -z "${VX_FLAGS}" ]; then 107 VCTX_ARGS="${VCTX_ARGS} -f $(util.array_to_list ${VX_FLAGS[@]}),PERSISTENT,STATE_SETUP "107 VCTX_ARGS="${VCTX_ARGS} -f $(util.array_to_list ${VX_FLAGS[@]}),PERSISTENT,STATE_SETUP,STATE_ADMIN" 108 108 else 109 VCTX_ARGS="${VCTX_ARGS} -f PERSISTENT,STATE_SETUP "109 VCTX_ARGS="${VCTX_ARGS} -f PERSISTENT,STATE_SETUP,STATE_ADMIN" 110 110 fi 111 ${_VNCONTEXT} -C -n ${VX_XID} -f PERSISTENT,STATE_SETUP 111 ${_VNCONTEXT} -C -n ${VX_XID} -f PERSISTENT,STATE_SETUP,STATE_ADMIN 112 112 ${_VCONTEXT} -C ${VCTX_ARGS} 113 113 ;; … … 254 254 255 255 run) 256 ${_VFLAGS} -S -f "~PERSISTENT,~STATE_SETUP " -x ${VX_XID}257 ${_VNFLAGS} -S -f "~PERSISTENT,~STATE_SETUP " -n ${VX_XID}256 ${_VFLAGS} -S -f "~PERSISTENT,~STATE_SETUP,~STATE_ADMIN" -x ${VX_XID} 257 ${_VNFLAGS} -S -f "~PERSISTENT,~STATE_SETUP,~STATE_ADMIN" -n ${VX_XID} 258 258 ;; 259 259 *) branches/1.0.4/src/libinternal/Makefile.am
r129 r348 20 20 -I$(top_builddir)/src 21 21 22 noinst_HEADERS = printf.h vlist.h syscall.h sys.h22 noinst_HEADERS = vlist.h 23 23 24 24 noinst_LIBRARIES = libinternal.a 25 25 26 libinternal_a_SOURCES = printf.c list.c sys_clone.c \26 libinternal_a_SOURCES = list.c \ 27 27 bcaps-list.c cflags-list.c nflags-list.c \ 28 28 sched-list.c ccaps-list.c iattr-list.c \ branches/1.0.4/src/libinternal/bcaps-list.c
r129 r348 38 38 list_key_alloc(#VALUE), \ 39 39 bcaps_list_data_alloc(TYPE ## _ ## VALUE)); 40 40 41 41 list_t *bcaps_list_init(void) 42 42 { 43 43 list_t *p = list_alloc(33); 44 44 45 45 int i = 0; 46 46 LIST_ADD_BCAP(1 << CAP, CHOWN) branches/1.0.4/src/libinternal/ccaps-list.c
r129 r348 38 38 list_key_alloc(#VALUE), \ 39 39 ccaps_list_data_alloc(TYPE ## _ ## VALUE)); 40 40 41 41 list_t *ccaps_list_init(void) 42 42 { 43 list_t *p = list_alloc( 8);44 43 list_t *p = list_alloc(10); 44 45 45 int i = 0; 46 46 LIST_ADD_CCAP(VXC, SET_UTSNAME) … … 52 52 LIST_ADD_CCAP(VXC, BINARY_MOUNT) 53 53 LIST_ADD_CCAP(VXC, QUOTA_CTL) 54 54 LIST_ADD_CCAP(VXC, ADMIN_MAPPER) 55 LIST_ADD_CCAP(VXC, ADMIN_CLOOP) 56 55 57 return p; 56 58 } branches/1.0.4/src/libinternal/cflags-list.c
r208 r348 38 38 list_key_alloc(#VALUE), \ 39 39 cflags_list_data_alloc(TYPE ## _ ## VALUE)); 40 40 41 41 list_t *cflags_list_init(void) 42 42 { 43 list_t *p = list_alloc(2 5);44 43 list_t *p = list_alloc(27); 44 45 45 int i = 0; 46 46 LIST_ADD_CFLAG(VXF, INFO_LOCK) … … 48 48 LIST_ADD_CFLAG(VXF, INFO_NPROC) 49 49 LIST_ADD_CFLAG(VXF, INFO_PRIVATE) 50 50 51 51 LIST_ADD_CFLAG(VXF, INFO_INIT) 52 52 LIST_ADD_CFLAG(VXF, INFO_HIDE) 53 53 LIST_ADD_CFLAG(VXF, INFO_ULIMIT) 54 54 LIST_ADD_CFLAG(VXF, INFO_NSPACE) 55 55 56 56 LIST_ADD_CFLAG(VXF, SCHED_HARD) 57 57 LIST_ADD_CFLAG(VXF, SCHED_PRIO) 58 58 LIST_ADD_CFLAG(VXF, SCHED_PAUSE) 59 59 60 60 LIST_ADD_CFLAG(VXF, VIRT_MEM) 61 61 LIST_ADD_CFLAG(VXF, VIRT_UPTIME) 62 62 LIST_ADD_CFLAG(VXF, VIRT_CPU) 63 63 LIST_ADD_CFLAG(VXF, VIRT_LOAD) 64 64 LIST_ADD_CFLAG(VXF, VIRT_TIME) 65 65 66 LIST_ADD_CFLAG(VXF, HIDE_MOUNT) 66 67 LIST_ADD_CFLAG(VXF, HIDE_NETIF) 67 68 68 69 LIST_ADD_CFLAG(VXF, STATE_SETUP) 69 70 LIST_ADD_CFLAG(VXF, STATE_INIT) 70 71 LIST_ADD_CFLAG(VXF, STATE_ADMIN) 72 71 73 LIST_ADD_CFLAG(VXF, SC_HELPER) 72 74 LIST_ADD_CFLAG(VXF, REBOOT_KILL) 73 75 LIST_ADD_CFLAG(VXF, PERSISTENT) 74 76 75 77 LIST_ADD_CFLAG(VXF, FORK_RSS) 76 78 LIST_ADD_CFLAG(VXF, PROLIFIC) 77 79 78 80 LIST_ADD_CFLAG(VXF, IGNEG_NICE) 79 80 /* LIST_ADD_CFLAG(VXF, ONE_TIME) */ 81 82 /* LIST_ADD_CFLAG(VXF, INIT_SET) */ 83 81 84 82 return p; 85 83 } branches/1.0.4/src/libinternal/iattr-list.c
r129 r348 38 38 list_key_alloc(#VALUE), \ 39 39 iattr_list_data_alloc(TYPE ## _ ## VALUE)); 40 40 41 41 list_t *iattr_list_init(void) 42 42 { 43 43 list_t *p = list_alloc(8); 44 44 45 45 int i = 0; 46 46 LIST_ADD_IATTR(IATTR, TAG) … … 52 52 LIST_ADD_IATTR(IATTR, IUNLINK) 53 53 LIST_ADD_IATTR(IATTR, IMMUTABLE) 54 54 55 55 return p; 56 56 } branches/1.0.4/src/libinternal/mflags-list.c
r129 r348 38 38 list_key_alloc(#VALUE), \ 39 39 cflags_list_data_alloc(TYPE ## _ ## VALUE)); 40 40 41 41 list_t *mflags_list_init(void) 42 42 { 43 43 list_t *p = list_alloc(2); 44 44 45 45 int i = 0; 46 46 LIST_ADD_CFLAG(VXM, SET_INIT) 47 47 LIST_ADD_CFLAG(VXM, SET_REAPER) 48 48 49 49 return p; 50 50 } branches/1.0.4/src/libinternal/nflags-list.c
r208 r348 38 38 list_key_alloc(#VALUE), \ 39 39 nflags_list_data_alloc(TYPE ## _ ## VALUE)); 40 40 41 41 list_t *nflags_list_init(void) 42 42 { 43 list_t *p = list_alloc( 3);44 43 list_t *p = list_alloc(5); 44 45 45 int i = 0; 46 LIST_ADD_NFLAG(NXF, INFO_LOCK) 46 47 LIST_ADD_NFLAG(NXF, STATE_SETUP) 48 LIST_ADD_NFLAG(NXF, STATE_ADMIN) 47 49 LIST_ADD_NFLAG(NXF, SC_HELPER) 48 50 LIST_ADD_NFLAG(NXF, PERSISTENT) 49 /* LIST_ADD_NFLAG(NXF, ONE_TIME) 50 LIST_ADD_NFLAG(NXF, INIT_SET) */ 51 51 52 52 return p; 53 53 } branches/1.0.4/src/libinternal/rlimit-list.c
r129 r348 39 39 list_key_alloc(#VALUE), \ 40 40 rlimit_list_data_alloc(TYPE ## _ ## VALUE)); 41 41 42 42 list_t *rlimit_list_init(void) 43 43 { 44 list_t *p = list_alloc( 9);45 44 list_t *p = list_alloc(12); 45 46 46 int i = 0; 47 47 /* TODO: check if we miss sth */ … … 51 51 LIST_ADD_RLIMIT(RLIMIT, MEMLOCK) 52 52 LIST_ADD_RLIMIT(RLIMIT, AS) 53 53 54 54 LIST_ADD_RLIMIT(VLIMIT, NSOCK) 55 55 LIST_ADD_RLIMIT(VLIMIT, OPENFD) 56 56 LIST_ADD_RLIMIT(VLIMIT, ANON) 57 57 LIST_ADD_RLIMIT(VLIMIT, SHMEM) 58 58 LIST_ADD_RLIMIT(VLIMIT, SEMARY) 59 LIST_ADD_RLIMIT(VLIMIT, NSEMS) 60 LIST_ADD_RLIMIT(VLIMIT, DENTRY) 61 59 62 return p; 60 63 } branches/1.0.4/src/libinternal/sched-list.c
r129 r348 41 41 list_t *sched_list_init(void) 42 42 { 43 list_t *p = list_alloc( 6);43 list_t *p = list_alloc(12); 44 44 45 45 int i = 0; 46 46 LIST_ADD_SCHED(VXSM, FILL_RATE) 47 47 LIST_ADD_SCHED(VXSM, INTERVAL) 48 LIST_ADD_SCHED(VXSM, FILL_RATE2) 49 LIST_ADD_SCHED(VXSM, INTERVAL2) 48 50 LIST_ADD_SCHED(VXSM, TOKENS) 49 51 LIST_ADD_SCHED(VXSM, TOKENS_MIN) 50 52 LIST_ADD_SCHED(VXSM, TOKENS_MAX) 51 53 LIST_ADD_SCHED(VXSM, PRIO_BIAS) 52 54 55 LIST_ADD_SCHED(VXSM, IDLE_TIME) 56 LIST_ADD_SCHED(VXSM, FORCE) 57 LIST_ADD_SCHED(VXSM, CPU_ID) 58 LIST_ADD_SCHED(VXSM, BUCKET_ID) 59 53 60 return p; 54 61 } branches/1.0.4/src/libvconfig/main.c
r129 r348 27 27 #include <stdio.h> 28 28 29 #include "printf.h"29 #include <lucid/printf.h> 30 30 #include "node.h" 31 31 #include "map.h" … … 101 101 102 102 for (i = 0; i < NR_MAP_ENTRIES; i++) { 103 vu_printf("%s\n", vconfig_map[i].key);103 _lucid_printf("%s\n", vconfig_map[i].key); 104 104 } 105 105 } branches/1.0.4/src/libvconfig/single.c
r82 r348 36 36 #include <libowfat/str.h> 37 37 38 #include "printf.h"38 #include <lucid/printf.h> 39 39 #include "pathconfig.h" 40 40 #include "vconfig.h" … … 104 104 105 105 char path[PATH_MAX]; 106 vu_snprintf(path, PATH_MAX, "%s/%s/%s", __PKGCONFDIR, name, res->path);106 _lucid_snprintf(path, PATH_MAX, "%s/%s/%s", __PKGCONFDIR, name, res->path); 107 107 108 108 unsigned long len; … … 127 127 128 128 char path[PATH_MAX]; 129 vu_snprintf(path, PATH_MAX, "%s/%s/%s", __PKGCONFDIR, name, res->path);129 _lucid_snprintf(path, PATH_MAX, "%s/%s/%s", __PKGCONFDIR, name, res->path); 130 130 131 131 char *buf; … … 181 181 182 182 if (value == 1) 183 vu_asprintf(&buf, "true\n");183 _lucid_asprintf(&buf, "true\n"); 184 184 else if (value == 0) 185 vu_asprintf(&buf, "false\n");185 _lucid_asprintf(&buf, "false\n"); 186 186 else 187 187 return -1; … … 218 218 char *buf; 219 219 220 vu_asprintf(&buf, "%d\n", value);220 _lucid_asprintf(&buf, "%d\n", value); 221 221 222 222 rc = _single_writekey(name, key, buf); … … 251 251 char *buf; 252 252 253 vu_asprintf(&buf, "%s\n", value);253 _lucid_asprintf(&buf, "%s\n", value); 254 254 255 255 rc = _single_writekey(name, key, buf); … … 297 297 char *buf; 298 298 299 vu_asprintf(&buf, "%s\n", value);299 _lucid_asprintf(&buf, "%s\n", value); 300 300 301 301 rc = _single_writekey(name, key, buf); branches/1.0.4/src/tools/Makefile.am
r208 r348 25 25 $(top_builddir)/src/libvconfig/libvconfig.a \ 26 26 -lowfat \ 27 -lvserver 27 -lvserver \ 28 -lucid 28 29 29 30 noinst_HEADERS = tools.h branches/1.0.4/src/tools/cowcp.c
r314 r348 37 37 #include <vserver.h> 38 38 39 #include "printf.h"39 #include <lucid/printf.h> 40 40 #include "tools.h" 41 41 #include "vlist.h" … … 62 62 void cmd_help() 63 63 { 64 vu_printf("Usage: %s <opts>* <src> <dst>\n"64 _lucid_printf("Usage: %s <opts>* <src> <dst>\n" 65 65 "\n" 66 66 "Available options:\n" … … 78 78 bool r = false; 79 79 if (S_ISDIR(st_mode)) { 80 vu_printf("Remove directory %s? [N/y]: ", dst);80 _lucid_printf("Remove directory %s? [N/y]: ", dst); 81 81 } else if (S_ISREG(st_mode)) { 82 vu_printf("Remove regular file %s? [N/y]: ", dst);82 _lucid_printf("Remove regular file %s? [N/y]: ", dst); 83 83 } else if (S_ISBLK(st_mode)) { 84 vu_printf("Remove block dev %s? [N/y]: ", dst);84 _lucid_printf("Remove block dev %s? [N/y]: ", dst); 85 85 } else if (S_ISCHR(st_mode)) { 86 vu_printf("Remove char dev %s? [N/y]: ", dst);86 _lucid_printf("Remove char dev %s? [N/y]: ", dst); 87 87 } else if (S_ISLNK(st_mode)) { 88 vu_printf("Remove symlink %s? [N/y]: ", dst);88 _lucid_printf("Remove symlink %s? [N/y]: ", dst); 89 89 } else if (S_ISFIFO(st_mode)) { 90 vu_printf("Remove fifo %s? [N/y]: ", dst);90 _lucid_printf("Remove fifo %s? [N/y]: ", dst); 91 91 } else if (S_ISSOCK(st_mode)) { 92 vu_printf("Remove socket %s? [N/y]: ", dst);92 _lucid_printf("Remove socket %s? [N/y]: ", dst); 93 93 } else 94 94 return false; … … 117 117 int r = errno = 0; 118 118 if (mkdir(dst, 0) == -1) { 119 vu_printf("mkdir(%s): %s\n", dst, strerror(r = errno));119 _lucid_printf("mkdir(%s): %s\n", dst, strerror(r = errno)); 120 120 goto out; 121 121 } 122 122 if (chown(dst, s_st->st_uid, s_st->st_gid) == -1) { 123 vu_printf("chown(%s): %s\n", dst, strerror(r = errno));123 _lucid_printf("chown(%s): %s\n", dst, strerror(r = errno)); 124 124 goto out; 125 125 } 126 126 if (chmod(dst, s_st->st_mode) == -1) { 127 vu_printf("chmod(%s): %s\n", dst, strerror(r = errno));127 _lucid_printf("chmod(%s): %s\n", dst, strerror(r = errno)); 128 128 goto out; 129 129 } … … 148 148 goto ok; 149 149 } 150 vu_printf("link(%s, %s): %s\n", src, dst, strerror(errno));150 _lucid_printf("link(%s, %s): %s\n", src, dst, strerror(errno)); 151 151 return -1; 152 152 } … … 154 154 iattr.filename = dst; 155 155 if (vx_set_iattr(&iattr) == -1) { 156 vu_printf("iattr(%s): %s\n", dst, strerror(errno));156 _lucid_printf("iattr(%s): %s\n", dst, strerror(errno)); 157 157 return -1; 158 158 } … … 166 166 struct stat d_st; 167 167 if (lstat(src, &s_st) == -1) { 168 vu_printf("lstat(%s): %s\n", src, strerror(errno));168 _lucid_printf("lstat(%s): %s\n", src, strerror(errno)); 169 169 return -1; 170 170 } … … 173 173 if (lstat(dst, &d_st) == -1) { 174 174 if (errno != ENOENT) { 175 vu_printf("lstat(%s): %s\n", dst, strerror(errno));175 _lucid_printf("lstat(%s): %s\n", dst, strerror(errno)); 176 176 return -1; 177 177 } … … 183 183 if (opts.force || confirm_del(d_st.st_mode, dst)) { 184 184 if (unlink(dst) == -1) { 185 vu_printf("unlink(%s): %s\n", dst, strerror(errno));185 _lucid_printf("unlink(%s): %s\n", dst, strerror(errno)); 186 186 return -1; 187 187 } 188 188 } else { 189 vu_printf("cp(%s): target untouched\n", dst);189 _lucid_printf("cp(%s): target untouched\n", dst); 190 190 return -1; 191 191 } … … 202 202 return cp_cow(src, dst); 203 203 } else if (S_ISBLK(s_st.st_mode)) { 204 vu_printf("cp(%s): block devices not supported\n", src);204 _lucid_printf("cp(%s): block devices not supported\n", src); 205 205 } else if (S_ISCHR(s_st.st_mode)) { 206 vu_printf("cp(%s): char devices not supported\n", src);206 _lucid_printf("cp(%s): char devices not supported\n", src); 207 207 } else if (S_ISLNK(s_st.st_mode)) { 208 vu_printf("cp(%s): symbolic links not supported\n", src);208 _lucid_printf("cp(%s): symbolic links not supported\n", src); 209 209 } else if (S_ISFIFO(s_st.st_mode)) { 210 vu_printf("cp(%s): fifos not supported\n", src);210 _lucid_printf("cp(%s): fifos not supported\n", src); 211 211 } else if (S_ISSOCK(s_st.st_mode)) { 212 vu_printf("cp(%s): sockets not supported\n", src);212 _lucid_printf("cp(%s): sockets not supported\n", src); 213 213 } 214 214 return -1; … … 289 289 /* check file argument */ 290 290 if (argc != optind + 2) { 291 vu_printf("Expecting exactly 1 source and 2 target\n");291 _lucid_printf("Expecting exactly 1 source and 2 target\n"); 292 292 errcnt = 1; 293 293 } else branches/1.0.4/src/tools/lockfile.c
r129 r348 35 35 #include <string.h> 36 36 37 #include "printf.h"37 #include <lucid/printf.h> 38 38 #include "tools.h" 39 39 … … 64 64 void cmd_help() 65 65 { 66 vu_printf("Usage: %s <opts>*\n"66 _lucid_printf("Usage: %s <opts>*\n" 67 67 "\n" 68 68 "Available options:\n" … … 172 172 173 173 char buf[7]; 174 vu_snprintf(buf, 7, "%d\n", getpid());174 _lucid_snprintf(buf, 7, "%d\n", getpid()); 175 175 176 176 if (write(lockfd, buf, 7) == -1) { branches/1.0.4/src/tools/nidof.c
r115 r348 27 27 #include <vserver.h> 28 28 29 #include "printf.h"29 #include <lucid/printf.h> 30 30 #include "tools.h" 31 31 … … 40 40 exit(EXIT_COMMAND); 41 41 42 vu_printf("%d\n", pid);42 _lucid_printf("%d\n", pid); 43 43 44 44 exit(EXIT_SUCCESS); branches/1.0.4/src/tools/tools.h
r129 r348 44 44 #define DEFAULT_GETOPT \ 45 45 default: \ 46 vu_printf("Try '%s -h' for more information\n", argv[0]); \46 _lucid_printf("Try '%s -h' for more information\n", argv[0]); \ 47 47 exit(EXIT_USAGE); \ 48 48 break; \ … … 50 50 51 51 #define CMD_VERSION(name, desc) do { \ 52 vu_printf("%s -- %s\n", name, desc); \53 vu_printf("This program is part of %s\n\n", PACKAGE_STRING); \54 vu_printf("Copyright (c) 2005 The vserver-utils Team\n"); \55 vu_printf("This program is free software; you can redistribute it and/or\n"); \56 vu_printf("modify it under the terms of the GNU General Public License\n"); \52 _lucid_printf("%s -- %s\n", name, desc); \ 53 _lucid_printf("This program is part of %s\n\n", PACKAGE_STRING); \ 54 _lucid_printf("Copyright (c) 2005 The vserver-utils Team\n"); \ 55 _lucid_printf("This program is free software; you can redistribute it and/or\n"); \ 56 _lucid_printf("modify it under the terms of the GNU General Public License\n"); \ 57 57 exit(0); \ 58 58 } while(0) … … 71 71 #define EXIT_OPTS 3 72 72 73 #define VPRINTF(opts, fmt, ...) if ((opts)->verbose) vu_printf(fmt , __VA_ARGS__ )73 #define VPRINTF(opts, fmt, ...) if ((opts)->verbose) _lucid_printf(fmt , __VA_ARGS__ ) 74 74 #ifdef DEBUG 75 #define DEBUGF(fmt, ...) vu_printf("DEBUG: " fmt , __VA_ARGS__ )75 #define DEBUGF(fmt, ...) _lucid_printf("DEBUG: " fmt , __VA_ARGS__ ) 76 76 #else 77 77 #define DEBUGF(fmt, ...) … … 79 79 80 80 #define EXIT(MSG,RC) { \ 81 vu_printf(MSG"; try '%s -h' for more information\n", argv[0]); \81 _lucid_printf(MSG"; try '%s -h' for more information\n", argv[0]); \ 82 82 exit(RC); \ 83 83 } 84 84 85 85 #define SEXIT(MSG,RC) { \ 86 vu_printf(MSG"\n"); \86 _lucid_printf(MSG"\n"); \ 87 87 exit(RC); \ 88 88 } branches/1.0.4/src/tools/vattr.c
r129 r348 37 37 #include <vserver.h> 38 38 39 #include "printf.h"39 #include <lucid/printf.h> 40 40 #include "tools.h" 41 41 #include "vlist.h" … … 80 80 void cmd_help() 81 81 { 82 vu_printf("Usage: %s <opts>* <file>*\n"82 _lucid_printf("Usage: %s <opts>* <file>*\n" 83 83 "\n" 84 84 "Available commands:\n" … … 158 158 /* syscall */ 159 159 if (vx_set_iattr(&iattr) == -1) { 160 vu_printf("vx_set_iattr(%s): %s\n", iattr.filename, strerror(errno));160 _lucid_printf("vx_set_iattr(%s): %s\n", iattr.filename, strerror(errno)); 161 161 return 1; 162 162 } … … 207 207 208 208 if (iattr.mask & IATTR_TAG) 209 vu_snprintf(ptr, 7, " %5d", iattr.xid);209 _lucid_snprintf(ptr, 7, " %5d", iattr.xid); 210 210 else 211 vu_snprintf(ptr, 7, " noxid");212 213 vu_printf("%s", buf);211 _lucid_snprintf(ptr, 7, " noxid"); 212 213 _lucid_printf("%s", buf); 214 214 215 215 if (src != 0) 216 vu_printf(" %s ->", src);216 _lucid_printf(" %s ->", src); 217 217 218 218 if (display != 0) 219 vu_printf(" %s\n", display);219 _lucid_printf(" %s\n", display); 220 220 else 221 vu_printf(" %s\n", file);221 _lucid_printf(" %s\n", file); 222 222 } 223 223 … … 237 237 238 238 if (lstat(file, &sb) == -1) { 239 vu_printf("lstat(%s): %s\n", file, strerror(errno));239 _lucid_printf("lstat(%s): %s\n", file, strerror(errno)); 240 240 return 1; 241 241 } … … 254 254 return 0; 255 255 256 vu_printf("readlink(%s): %s\n", display, strerror(errno));256 _lucid_printf("readlink(%s): %s\n", display, strerror(errno)); 257 257 return 1; 258 258 } … … 262 262 if (opts.follow) { 263 263 if (stat(link_buf, &sb) == -1) { 264 vu_printf("stat(%s): %s\n", link_buf, strerror(errno));264 _lucid_printf("stat(%s): %s\n", link_buf, strerror(errno)); 265 265 return 1; 266 266 } … … 286 286 287 287 if (dir == 0) { 288 vu_printf("opendir(%s): %s\n", path, strerror(errno));288 _lucid_printf("opendir(%s): %s\n", path, strerror(errno)); 289 289 return 1; 290 290 } … … 306 306 while ((ent = readdir(dir)) != 0) { 307 307 if (lstat(ent->d_name, &sb) == -1) { 308 vu_printf("lstat(%s): %s\n", ent->d_name, strerror(errno));308 _lucid_printf("lstat(%s): %s\n", ent->d_name, strerror(errno)); 309 309 return errcnt + 1; 310 310 } … … 356 356 357 357 if (lstat(path, &st) == -1) { 358 vu_printf("lstat(%s): %s\n", path, strerror(errno));358 _lucid_printf("lstat(%s): %s\n", path, strerror(errno)); 359 359 return 1; 360 360 } branches/1.0.4/src/tools/vconfig.c
r129 r348 30 30 #include <vserver.h> 31 31 32 #include "printf.h"32 #include <lucid/printf.h> 33 33 #include "tools.h" 34 34 #include "vconfig.h" … … 51 51 void cmd_help() 52 52 { 53 vu_printf("Usage: %s <command> <opts>*\n"53 _lucid_printf("Usage: %s <command> <opts>*\n" 54 54 "\n" 55 55 "Available commands:\n" … … 134 134 if (buf != -1) { 135 135 if (buf == 1) 136 vu_printf("true\n");136 _lucid_printf("true\n"); 137 137 else 138 vu_printf("false\n");138 _lucid_printf("false\n"); 139 139 } 140 140 } … … 143 143 int buf = vconfig_get_int(opts.name, opts.key); 144 144 if (buf != -1) 145 vu_printf("%d\n", buf);145 _lucid_printf("%d\n", buf); 146 146 } 147 147 … … 150 150 151 151 if (buf != NULL) { 152 vu_printf("%s\n", buf);152 _lucid_printf("%s\n", buf); 153 153 free(buf); 154 154 } … … 159 159 160 160 if (buf != NULL) { 161 vu_printf("%s\n", buf);161 _lucid_printf("%s\n", buf); 162 162 free(buf); 163 163 } … … 170 170 } 171 171 case VCFG_SET: { 172 vu_printf("SET command not implemented\n");172 _lucid_printf("SET command not implemented\n"); 173 173 return -1; 174 174 break; branches/1.0.4/src/tools/vcontext.c
r134 r348 30 30 #include <vserver.h> 31 31 32 #include "printf.h"32 #include <lucid/printf.h> 33 33 #include "tools.h" 34 34 #include "vlist.h" … … 58 58 void cmd_help() 59 59 { 60 vu_printf("Usage: %s <command> <opts>* -- <program> <args>*\n"60 _lucid_printf("Usage: %s <command> <opts>* -- <program> <args>*\n" 61 61 "\n" 62 62 "Available commands:\n" … … 188 188 case VCTX_CREATE: { 189 189 struct vx_create_flags create_flags = { 190 .flags = VXF_STATE_SETUP | opts.flags,191 }; 192 190 .flags = VXF_STATE_SETUP | VXF_STATE_ADMIN | opts.flags, 191 }; 192 193 193 /* syscall */ 194 194 if (vx_create(opts.xid, &create_flags) == -1) 195 195 PEXIT("Failed to create context", EXIT_COMMAND);
