@@ -424,27 +424,17 @@ static void printhelp(FILE *out,const char *progname)
424
424
fflush (out );
425
425
}
426
426
427
- enum {
428
- Q_ADDITIONAL = 101 ,
429
- Q_UNRECOGNISED ,
430
- Q_NOSTATISTICS ,
431
- Q_FAILOPENOUTPUT ,
432
- Q_FAILTHREAD ,
433
- Q_FAILTIME ,
434
- Q_FAILOPENINPUT ,
435
- } ;
436
-
437
427
static void e_additional ()
438
428
{
439
429
fprintf (stderr ,"additional argument required\n" );
440
- exit (Q_ADDITIONAL );
430
+ exit (1 );
441
431
}
442
432
443
433
#ifndef STATISTICS
444
434
static void e_nostatistics ()
445
435
{
446
436
fprintf (stderr ,"statistics support not compiled in\n" );
447
- exit (Q_NOSTATISTICS );
437
+ exit (1 );
448
438
}
449
439
#endif
450
440
@@ -526,7 +516,7 @@ int main(int argc,char **argv)
526
516
if (* arg == '-' ) {
527
517
if (numargit > 1 ) {
528
518
fprintf (stderr ,"unrecognised argument: -\n" );
529
- exit (Q_UNRECOGNISED );
519
+ exit (1 );
530
520
}
531
521
++ arg ;
532
522
if (!* arg )
@@ -537,7 +527,7 @@ int main(int argc,char **argv)
537
527
}
538
528
else {
539
529
fprintf (stderr ,"unrecognised argument: --%s\n" ,arg );
540
- exit (Q_UNRECOGNISED );
530
+ exit (1 );
541
531
}
542
532
numargit = 0 ;
543
533
}
@@ -644,14 +634,14 @@ int main(int argc,char **argv)
644
634
hostname = 0 ;
645
635
if (hostname && strlen (hostname ) != ONION_LEN ) {
646
636
fprintf (stderr ,"bad onion argument length\n" );
647
- exit (Q_UNRECOGNISED );
637
+ exit (1 );
648
638
}
649
639
}
650
640
}
651
641
}
652
642
else {
653
643
fprintf (stderr ,"unrecognised argument: -%c\n" ,* arg );
654
- exit (Q_UNRECOGNISED );
644
+ exit (1 );
655
645
}
656
646
if (numargit )
657
647
goto nextarg ;
@@ -664,13 +654,13 @@ int main(int argc,char **argv)
664
654
fout = fopen (outfile ,!outfileoverwrite ? "a" : "w" );
665
655
if (!fout ) {
666
656
perror ("failed to open output file" );
667
- exit (Q_FAILOPENOUTPUT );
657
+ exit (1 );
668
658
}
669
659
}
670
660
671
661
if (!fout && yamloutput ) {
672
662
fprintf (stderr ,"nil output with yaml mode does not make sense\n" );
673
- exit (Q_FAILOPENOUTPUT ); // define new err code?
663
+ exit (1 );
674
664
}
675
665
676
666
if (workdir )
@@ -694,7 +684,7 @@ int main(int argc,char **argv)
694
684
fin = fopen (infile ,"r" );
695
685
if (!fin ) {
696
686
fprintf (stderr ,"failed to open input file\n" );
697
- return Q_FAILOPENINPUT ;
687
+ return 1 ;
698
688
}
699
689
}
700
690
tret = yamlin_parseandcreate (fin ,sname ,hostname );
@@ -775,7 +765,7 @@ int main(int argc,char **argv)
775
765
tret = pthread_create (& VEC_BUF (threads ,i ),tattrp ,fastkeygen ? dofastwork : dowork ,tp );
776
766
if (tret ) {
777
767
fprintf (stderr ,"error while making " FSZ "th thread: %s\n" ,i ,strerror (tret ));
778
- exit (Q_FAILTHREAD );
768
+ exit (1 );
779
769
}
780
770
}
781
771
@@ -790,7 +780,7 @@ int main(int argc,char **argv)
790
780
u64 istarttime ,inowtime ,ireporttime = 0 ,elapsedoffset = 0 ;
791
781
if (clock_gettime (CLOCK_MONOTONIC ,& nowtime ) < 0 ) {
792
782
perror ("failed to get time" );
793
- exit (Q_FAILTIME );
783
+ exit (1 );
794
784
}
795
785
istarttime = (1000000 * (u64 )nowtime .tv_sec ) + ((u64 )nowtime .tv_nsec / 1000 );
796
786
#endif
0 commit comments