diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2006-12-07 21:53:58 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2006-12-07 21:53:58 (GMT) |
commit | 8f5f04bff27812dde0a888fceadaf1a3dc17cc8e (patch) | |
tree | 374a575d4f8207c08e6ed103cafd12a4644761f8 /tools | |
parent | 801aba05c019c6842aa63712cc6eb4847fb2dd58 (diff) | |
download | hdf5-8f5f04bff27812dde0a888fceadaf1a3dc17cc8e.zip hdf5-8f5f04bff27812dde0a888fceadaf1a3dc17cc8e.tar.gz hdf5-8f5f04bff27812dde0a888fceadaf1a3dc17cc8e.tar.bz2 |
[svn-r13033]
avoid usage to call exit(1), it makes processes to stop in parallel.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5diff/h5diff_common.c | 29 | ||||
-rw-r--r-- | tools/h5diff/h5diff_common.h | 2 |
2 files changed, 18 insertions, 13 deletions
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index fd261b1..3e37979 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -45,12 +45,12 @@ void parse_input(int argc, */ if ( argc==2 && (strcmp("-h",argv[1])==0) ) - usage(1); + usage(); if ( argc<3 ) { printf("Number of arguments is only %d\n", argc ); - usage(1); + usage(); } /*------------------------------------------------------------------------- @@ -76,10 +76,10 @@ void parse_input(int argc, switch (*s) { default: printf("-%s is an invalid option\n", s ); - usage(1); + usage(); break; case 'h': - usage(0); + usage(); break; case 'v': options->m_verbose = 1; @@ -99,7 +99,7 @@ void parse_input(int argc, if ( check_f_input(argv[i+1])==-1) { printf("<-d %s> is not a valid option\n", argv[i+1] ); - usage(1); + usage(); } options->delta = atof(argv[i+1]); i++; /* go to next */ @@ -107,7 +107,7 @@ void parse_input(int argc, else { printf("Not a valid -d option\n"); - usage(1); + usage(); } break; case 'p': @@ -117,7 +117,7 @@ void parse_input(int argc, if ( check_f_input(argv[i+1])==-1) { printf("<-p %s> is not a valid option\n", argv[i+1] ); - usage(1); + usage(); } options->percent = atof(argv[i+1]); i++; /* go to next */ @@ -125,7 +125,7 @@ void parse_input(int argc, else { printf("Not a valid -p option\n"); - usage(1); + usage(); } break; case 'n': @@ -135,7 +135,7 @@ void parse_input(int argc, if ( check_n_input(argv[i+1])==-1) { printf("<-n %s> is not a valid option\n", argv[i+1] ); - usage(1); + usage(); } options->count = atol(argv[i+1]); i++; /* go to next */ @@ -143,7 +143,7 @@ void parse_input(int argc, else { printf("Not a valid -n option\n"); - usage(1); + usage(); } break; } /*switch*/ @@ -288,7 +288,7 @@ int check_f_input( const char *str ) * *------------------------------------------------------------------------- */ -void usage(int status) +void usage(void) { printf("usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] \n"); printf("\n"); @@ -343,7 +343,12 @@ void usage(int status) printf("1) datasets: numerical array differences 2) groups: name string difference "); printf("3) datatypes: the return value of H5Tequal 2) links: name string difference of the linked value\n"); - h5diff_exit(status); + #ifdef H5_HAVE_PARALLEL + if(g_Parallel) + h5diff_exit(0); + else +#endif + exit(0); } /*------------------------------------------------------------------------- diff --git a/tools/h5diff/h5diff_common.h b/tools/h5diff/h5diff_common.h index 0faa6c7..31b1b29 100644 --- a/tools/h5diff/h5diff_common.h +++ b/tools/h5diff/h5diff_common.h @@ -15,7 +15,7 @@ extern unsigned char g_Parallel; extern int g_nTasks; -void usage(int status); +void usage(void); int check_n_input( const char* ); int check_f_input( const char* ); void parse_input(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* options); |