Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename HDexit() and related to exit(), etc. #3202

Merged
merged 2 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/H5.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ H5_init_library(void)
* This must be entered before the library cleanup code so it's
* executed in LIFO order (i.e., last).
*/
(void)HDatexit(H5TS_win32_process_exit);
(void)atexit(H5TS_win32_process_exit);
#endif /* H5_HAVE_THREADSAFE && H5_HAVE_WIN_THREADS */

/* Normal library termination code */
(void)HDatexit(H5_term_library);
(void)atexit(H5_term_library);

H5_dont_atexit_g = TRUE;
} /* end if */
Expand Down
2 changes: 1 addition & 1 deletion src/H5FDsubfiling/H5FDsubfiling.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ H5FD_subfiling_init(void)
H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTINIT, H5I_INVALID_HID,
"MPI doesn't support MPI_Init_thread with MPI_THREAD_MULTIPLE");

if (HDatexit(H5FD__subfiling_mpi_finalize) < 0)
if (atexit(H5FD__subfiling_mpi_finalize) < 0)
H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTINIT, H5I_INVALID_HID,
"can't register atexit handler for MPI_Finalize");
}
Expand Down
9 changes: 0 additions & 9 deletions src/H5private.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,6 @@ typedef off_t h5_stat_size_t;
#ifndef HDasprintf
#define HDasprintf asprintf /*varargs*/
#endif
#ifndef HDatexit
#define HDatexit(F) atexit(F)
#endif
#ifndef HDatof
#define HDatof(S) atof(S)
#endif
Expand Down Expand Up @@ -665,12 +662,6 @@ typedef off_t h5_stat_size_t;
#ifndef HDdifftime
#define HDdifftime(X, Y) difftime(X, Y)
#endif
#ifndef HDexit
#define HDexit(N) exit(N)
#endif
#ifndef HD_exit
#define HD_exit(N) _exit(N)
#endif
#ifndef HDfabs
#define HDfabs(X) fabs(X)
#endif
Expand Down
2 changes: 1 addition & 1 deletion test/API/H5_api_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,5 @@ main(int argc, char **argv)
MPI_Finalize();
#endif

HDexit(((err_occurred || n_tests_failed_g > 0) ? EXIT_FAILURE : EXIT_SUCCESS));
exit(((err_occurred || n_tests_failed_g > 0) ? EXIT_FAILURE : EXIT_SUCCESS));
}
4 changes: 2 additions & 2 deletions test/API/testhdf5.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,10 +722,10 @@ main(int argc, char *argv[])
/* No need to print anything since PerformTests() already does. */
if (nerrors /* GetTestNumErrs() */ > 0) {
printf("** HDF5 tests failed with %d errors **\n", nerrors);
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}
else {
printf("** HDF5 tests ran successfully **\n");
HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);
}
} /* end main() */
4 changes: 2 additions & 2 deletions test/bittests.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,11 +933,11 @@ main(void)

if (nerrors) {
printf("***** %u FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S");
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}
printf("All bit tests passed.\n");

H5close();

HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);
} /* end main() */
2 changes: 1 addition & 1 deletion test/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -34072,7 +34072,7 @@ main(void)

if (!h5_using_default_driver(NULL)) {
HDputs(" -- SKIPPED for incompatible VFD --");
HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);
}

if (create_entry_arrays() < 0) {
Expand Down
4 changes: 2 additions & 2 deletions test/cache_logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ main(void)

if (nerrors) {
printf("***** %d Metadata cache logging TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : "");
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}

printf("All Metadata Cache Logging tests passed.\n");

HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);
}
2 changes: 1 addition & 1 deletion test/cache_tagging.c
Original file line number Diff line number Diff line change
Expand Up @@ -4575,7 +4575,7 @@ main(void)
/* Only run with sec2/default driver */
if (!h5_using_default_driver(NULL)) {
HDputs(" -- SKIPPED for incompatible VFD --");
HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);
}

/* ========== */
Expand Down
4 changes: 2 additions & 2 deletions test/cmpd_dset.c
Original file line number Diff line number Diff line change
Expand Up @@ -2217,7 +2217,7 @@ main(int argc, char *argv[])
if (argc > 1) {
if (argc > 2 || HDstrcmp("--noopt", argv[1]) != 0) {
fprintf(stderr, "usage: %s [--noopt]\n", argv[0]);
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}
H5Tunregister(H5T_PERS_DONTCARE, NULL, (hid_t)-1, (hid_t)-1,
(H5T_conv_t)((void (*)(void))H5T__conv_struct_opt));
Expand Down Expand Up @@ -2250,7 +2250,7 @@ main(int argc, char *argv[])

if (nerrors) {
printf("***** %u FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S");
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}

h5_cleanup(FILENAME, fapl_id);
Expand Down
4 changes: 2 additions & 2 deletions test/cross_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,11 @@ main(void)
*/
if (h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible) < 0) {
HDputs(" -- couldn't check if VFD is compatible with default VFD --");
HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);
}
if (!driver_is_default_compatible) {
HDputs(" -- SKIPPED for incompatible VFD --");
HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);
}

HDputs("\n");
Expand Down
2 changes: 1 addition & 1 deletion test/del_many_dense_attrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static const char *FILENAME[] = {"del_many_dense_attrs", NULL};
static void
catch_signal(int H5_ATTR_UNUSED signo)
{
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
} /* catch_signal() */

/*-------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions test/dsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -15848,7 +15848,7 @@ main(void)
free(points_dbl_data);
free(check_dbl_data);

HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);

error:
free(points);
Expand All @@ -15863,5 +15863,5 @@ main(void)

nerrors = MAX(1, nerrors);
printf("***** %d DATASET TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
} /* end main() */
12 changes: 6 additions & 6 deletions test/dt_arith.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ fpe_handler(int H5_ATTR_UNUSED signo)
HDputs(" Remaining tests could not be run.");
HDputs(" Please turn off SIGFPE on overflows and try again.");
#endif
HDexit(255);
exit(255);
}

/*-------------------------------------------------------------------------
Expand Down Expand Up @@ -3305,9 +3305,9 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst)
HDfflush(stdout);
#ifdef HANDLE_SIGFPE
if (run_test == TEST_NOOP || run_test == TEST_NORMAL)
HDexit(MIN((int)fails_all_tests, 254));
exit(MIN((int)fails_all_tests, 254));
else if (run_test == TEST_DENORM || run_test == TEST_SPECIAL)
HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);
assert(0 && "Should not reach this point!");
return 1;
#else
Expand All @@ -3334,9 +3334,9 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst)
HDfflush(stdout);
#ifdef HANDLE_SIGFPE
if (run_test == TEST_NOOP || run_test == TEST_NORMAL)
HDexit(MIN(MAX((int)fails_all_tests, 1), 254));
exit(MIN(MAX((int)fails_all_tests, 1), 254));
else if (run_test == TEST_DENORM || run_test == TEST_SPECIAL)
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
assert(0 && "Should not reach this point!");
return 1;
#else
Expand Down Expand Up @@ -5230,7 +5230,7 @@ main(void)

if (nerrors) {
printf("***** %lu FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S");
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}
printf("All data type tests passed.\n");
return 0;
Expand Down
4 changes: 2 additions & 2 deletions test/dtypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -8890,7 +8890,7 @@ main(void)

if (h5_using_parallel_driver(fapl, &driver_is_parallel) < 0) {
printf("Can't check if driver is parallel-enabled\n");
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}

if (ALIGNMENT)
Expand Down Expand Up @@ -8963,7 +8963,7 @@ main(void)

if (nerrors) {
printf("***** %lu FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S");
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}

printf("All datatype tests passed.\n");
Expand Down
4 changes: 2 additions & 2 deletions test/event_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,9 @@ main(void)
/* Report status */
HDputs("All event set tests passed.");

HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);

error:
HDputs("***** EVENT SET TESTS FAILED *****");
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
} /* end main() */
8 changes: 4 additions & 4 deletions test/evict_on_close.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ main(void)

printf("All evict-on-close tests passed.\n");

HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);

error:

Expand All @@ -971,7 +971,7 @@ main(void)
}
H5E_END_TRY

HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);

} /* end main() */

Expand Down Expand Up @@ -1049,13 +1049,13 @@ main(void)
printf("All evict-on-close tests passed.\n");
printf("Note that EoC is not supported under parallel so most tests are skipped.\n");

HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);

error:

printf("***** %u evict-on-close test%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : "");

HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);

} /* main() - parallel */

Expand Down
6 changes: 3 additions & 3 deletions test/extend.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ main(void)

if (nerrors) {
printf("***** %d FAILURE%s! *****\n", nerrors, (1 == nerrors) ? "" : "S");
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
} /* end if */

printf("All extend tests passed.\n");
Expand All @@ -350,7 +350,7 @@ main(void)
free(buf2);
free(buf2_data);

HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);

error:

Expand All @@ -360,5 +360,5 @@ main(void)
free(buf2_data);

printf("*** One or more extend tests failed ***\n");
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
} /* end main() */
4 changes: 2 additions & 2 deletions test/farray.c
Original file line number Diff line number Diff line change
Expand Up @@ -1792,7 +1792,7 @@ main(void)
/* Clean up file used */
h5_cleanup(FILENAME, fapl);

HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);

error:
HDputs("*** TESTS FAILED ***");
Expand All @@ -1806,5 +1806,5 @@ main(void)
if (api_ctx_pushed)
H5CX_pop(FALSE);

HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
} /* end main() */
8 changes: 4 additions & 4 deletions test/filenotclosed.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
static void
catch_signal(int H5_ATTR_UNUSED signo)
{
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
} /* catch_signal() */

/*-------------------------------------------------------------------------
Expand Down Expand Up @@ -80,7 +80,7 @@ main(void)
if (!contig_addr_vfd) {
SKIPPED();
HDputs(" Temporary skipped for a spilt/multi driver");
HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);
}

h5_reset();
Expand Down Expand Up @@ -136,9 +136,9 @@ main(void)
/* The file is not closed. */
/* The library will call H5_term_library to shut down the library. */

HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);

error:
HDputs("*** TEST FAILED ***");
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}
6 changes: 3 additions & 3 deletions test/fillval.c
Original file line number Diff line number Diff line change
Expand Up @@ -2649,7 +2649,7 @@ main(int argc, char *argv[])
test_compact = 1;
else {
fprintf(stderr, "usage: %s [contiguous] [chunked] [compact]\n", argv[0]);
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}
} /* end for */
} /* end if */
Expand Down Expand Up @@ -2725,9 +2725,9 @@ main(int argc, char *argv[])
if (h5_cleanup(FILENAME, fapl))
HDremove(FILE_NAME_RAW);

HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);

error:
HDputs("***** FILL VALUE TESTS FAILED *****");
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}
4 changes: 2 additions & 2 deletions test/filter_fail.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,11 @@ main(void)
if (nerrors)
TEST_ERROR;

HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);

error:
if (nerrors) {
printf("***** %u FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S");
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}
} /* end main() */
4 changes: 2 additions & 2 deletions test/filter_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ main(void)

printf("All plugin tests passed.\n");

HDexit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);

error:
H5E_BEGIN_TRY
Expand All @@ -1638,5 +1638,5 @@ main(void)

nerrors = MAX(1, nerrors);
printf("***** %d PLUGIN TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
HDexit(EXIT_FAILURE);
exit(EXIT_FAILURE);
} /* end main() */
Loading