- Timestamp:
- Jan 26, 2015, 8:20:04 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/mondoarchive/mondoarchive.c
r3208 r3333 165 165 FILE *fin = NULL; 166 166 167 /* Make sure I'm root; abort if not */168 if (getuid() != 0) {169 fprintf(stderr, "Please run as root.\r\n");170 finish(127);171 }172 173 167 /* If -V, -v or --version then echo version no. and quit */ 174 168 if (argc == 2 && (!strcmp(argv[argc - 1], "-v") || !strcmp(argv[argc - 1], "-V") || !strcmp(argv[argc - 1], "--version"))) { 175 169 printf("mondoarchive v%s\nSee man page for help\n", PACKAGE_VERSION); 176 finish(0); 170 if (getuid() != 0) fprintf(stderr, "Please run the mondoarchive command as root.\n"); 171 exit(0); 172 } 173 174 /* Make sure I'm root; abort if not */ 175 if (getuid() != 0) { 176 fprintf(stderr, "Please run as root.\n"); 177 exit(127); 177 178 } 178 179 … … 184 185 if (!(bkpinfo = (struct s_bkpinfo *)malloc(sizeof(struct s_bkpinfo)))) { 185 186 fprintf(stderr, "Cannot malloc bkpinfo\n"); 186 finish(-1); 187 } 187 exit(-1); 188 } 189 /* Now on we can use finish to exit as bkpingo has been initialized */ 188 190 log_msg(9, "reset_bkpinfo"); 189 191 reset_bkpinfo();
Note:
See TracChangeset
for help on using the changeset viewer.