~ubuntu-branches/debian/sid/ntfs-3g/sid

« back to all changes in this revision

Viewing changes to ntfsprogs/ntfsclone.c

  • Committer: Package Import Robot
  • Author(s): Daniel Baumann
  • Date: 2014-06-11 07:05:11 UTC
  • Revision ID: package-import@ubuntu.com-20140611070511-uff0av8cy0p2j3ty
Tags: 1:2014.2.15AR.1-2
* Adding patch from upstream to fix type inconsistencies in
  ntfs_initialize_file_security (Closes: #749517).
* Moving undocumented ntfsdump_logfile, ntfsmftalloc, and ntfsck to
  ntfs-3g-dev (Closes: #747872).
* Adding patch from upstream to correct exit values (Closes: #741992).

Show diffs side-by-side

added added

removed removed

Lines of Context:
347
347
 
348
348
 
349
349
__attribute__((noreturn))
350
 
static void usage(void)
 
350
static void usage(int ret)
351
351
{
352
352
        fprintf(stderr, "\nUsage: %s [OPTIONS] SOURCE\n"
353
353
                "    Efficiently clone NTFS to a sparse file, image, device or standard output.\n"
375
375
                "    and --restore-image is used then read the image from the standard input.\n"
376
376
                "\n", EXEC_NAME);
377
377
        fprintf(stderr, "%s%s", ntfs_bugs, ntfs_home);
378
 
        exit(1);
 
378
        exit(ret);
379
379
}
380
380
 
381
381
/**
390
390
                   "Copyright (c) 2004-2006 Anton Altaparmakov\n"
391
391
                   "Copyright (c) 2010-2014 Jean-Pierre Andre\n\n");
392
392
        fprintf(stderr, "%s\n%s%s", ntfs_gpl, ntfs_bugs, ntfs_home);
393
 
        exit(1);
 
393
        exit(0);
394
394
}
395
395
 
396
396
static void parse_options(int argc, char **argv)
426
426
                switch (c) {
427
427
                case 1: /* A non-option argument */
428
428
                        if (opt.volume)
429
 
                                usage();
 
429
                                usage(1);
430
430
                        opt.volume = argv[optind-1];
431
431
                        break;
432
432
                case 'd':
439
439
                        opt.force++;
440
440
                        break;
441
441
                case 'h':
 
442
                        usage(0);
442
443
                case '?':
443
 
                        usage();
 
444
                        usage(1);
444
445
                case 'i':       /* not proposed as a short option */
445
446
                        opt.new_serial |= 1;
446
447
                        break;
457
458
                        opt.overwrite++;
458
459
                case 'o':
459
460
                        if (opt.output)
460
 
                                usage();
 
461
                                usage(1);
461
462
                        opt.output = optarg;
462
463
                        break;
463
464
                case 'r':
480
481
                        break;
481
482
                default:
482
483
                        err_printf("Unknown option '%s'.\n", argv[optind-1]);
483
 
                        usage();
 
484
                        usage(1);
484
485
                }
485
486
        }
486
487
 
487
488
        if (!opt.no_action && (opt.output == NULL)) {
488
489
                err_printf("You must specify an output file.\n");
489
 
                usage();
 
490
                usage(1);
490
491
        }
491
492
 
492
493
        if (!opt.no_action && (strcmp(opt.output, "-") == 0))
494
495
 
495
496
        if (opt.volume == NULL) {
496
497
                err_printf("You must specify a device file.\n");
497
 
                usage();
 
498
                usage(1);
498
499
        }
499
500
 
500
501
        if (!opt.restore_image && !strcmp(opt.volume, "-")) {
501
502
                err_printf("Only special images can be read from standard input\n");
502
 
                usage();
 
503
                usage(1);
503
504
        }
504
505
 
505
506
        if (opt.metadata && opt.save_image) {