Changeset 2559
- Timestamp:
- 07/10/07 22:35:47 (1 year ago)
- Files:
-
- trunk/src/vclone.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/vclone.c
r2494 r2559 41 41 #define ENSC_WRAPPERS_FCNTL 1 42 42 #define ENSC_WRAPPERS_DIRENT 1 43 #define ENSC_WRAPPERS_VSERVER 1 43 44 #include <wrappers.h> 44 45 45 46 #define CMD_HELP 0x8000 46 47 #define CMD_VERSION 0x8001 48 #define CMD_XID 0x8002 47 49 48 50 struct WalkdownInfo … … 55 57 struct Arguments { 56 58 unsigned int verbosity; 59 xid_t xid; 57 60 }; 58 61 … … 66 69 { "help", no_argument, 0, CMD_HELP }, 67 70 { "version", no_argument, 0, CMD_VERSION }, 71 { "xid", required_argument, 0, CMD_XID }, 68 72 { 0,0,0,0 } 69 73 }; … … 78 82 WRITE_STR(fd, cmd); 79 83 WRITE_MSG(fd, 80 " <source> <absolute path to destination>\n\n"84 " [--xid <xid>] <source> <absolute path to destination>\n\n" 81 85 "Please report bugs to " PACKAGE_BUGREPORT "\n"); 82 86 exit(res); … … 138 142 } 139 143 else { 140 if (!Unify_copy(src_d_path.d, &f_stat, dst_path.d)) {144 if (!Unify_copy(src_d_path.d, &f_stat, dst_path.d)) 141 145 perror(ENSC_WRAPPERS_PREFIX "Unify_copy()"); 142 exit(wrapper_exit_code); 143 } 144 res = 0; 146 else if (vc_set_iattr(dst_path.d, global_args->xid, 0, VC_IATTR_XID) == -1) 147 perror(ENSC_WRAPPERS_PREFIX "vc_set_iattr()"); 148 else 149 res = 0; 145 150 } 146 151 if (S_ISDIR(f_stat.st_mode)) … … 155 160 struct Arguments args = { 156 161 .verbosity = 0, 162 .xid = VC_NOCTX, 157 163 }; 158 164 uint64_t res; … … 161 167 global_args = &args; 162 168 while (1) { 163 int c = getopt_long(argc, argv, "+ ",169 int c = getopt_long(argc, argv, "+v", 164 170 CMDLINE_OPTIONS, 0); 165 171 if (c==-1) break; … … 168 174 case CMD_HELP : showHelp(1, argv[0], 0); 169 175 case CMD_VERSION : showVersion(); 176 case 'v' : args.verbosity++; break; 177 case CMD_XID : args.xid = Evc_xidopt2xid(optarg,true); break; 170 178 default : 171 179 WRITE_MSG(2, "Try '");
