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

Removes checks for system(), which is C89/90 #782

Merged
merged 1 commit into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 0 additions & 3 deletions config/cmake/H5pubconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,6 @@
/* Define to 1 if you have the `symlink' function. */
#cmakedefine H5_HAVE_SYMLINK @H5_HAVE_SYMLINK@

/* Define to 1 if you have the `system' function. */
#cmakedefine H5_HAVE_SYSTEM @H5_HAVE_SYSTEM@

/* Define to 1 if you have the <sys/file.h> header file. */
#cmakedefine H5_HAVE_SYS_FILE_H @H5_HAVE_SYS_FILE_H@

Expand Down
2 changes: 0 additions & 2 deletions config/cmake_ext_mod/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ if (WINDOWS)
set (${HDF_PREFIX}_HAVE_WIN32_API 1)
set (${HDF_PREFIX}_HAVE_LIBM 1)
set (${HDF_PREFIX}_HAVE_STRDUP 1)
set (${HDF_PREFIX}_HAVE_SYSTEM 1)
set (${HDF_PREFIX}_HAVE_LONGJMP 1)
if (NOT MINGW)
set (${HDF_PREFIX}_HAVE_GETHOSTNAME 1)
Expand Down Expand Up @@ -494,7 +493,6 @@ CHECK_FUNCTION_EXISTS (sigprocmask ${HDF_PREFIX}_HAVE_SIGPROCMASK)
CHECK_FUNCTION_EXISTS (srandom ${HDF_PREFIX}_HAVE_SRANDOM)
CHECK_FUNCTION_EXISTS (strdup ${HDF_PREFIX}_HAVE_STRDUP)
CHECK_FUNCTION_EXISTS (symlink ${HDF_PREFIX}_HAVE_SYMLINK)
CHECK_FUNCTION_EXISTS (system ${HDF_PREFIX}_HAVE_SYSTEM)

CHECK_FUNCTION_EXISTS (tmpfile ${HDF_PREFIX}_HAVE_TMPFILE)
CHECK_FUNCTION_EXISTS (asprintf ${HDF_PREFIX}_HAVE_ASPRINTF)
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2029,7 +2029,7 @@ AC_CHECK_FUNCS([alarm clock_gettime difftime fcntl flock fork frexpf])
AC_CHECK_FUNCS([frexpl gethostname getrusage gettimeofday])
AC_CHECK_FUNCS([lstat rand_r random setsysinfo])
AC_CHECK_FUNCS([signal longjmp setjmp siglongjmp sigsetjmp sigprocmask])
AC_CHECK_FUNCS([srandom strdup symlink system])
AC_CHECK_FUNCS([srandom strdup symlink])
AC_CHECK_FUNCS([tmpfile asprintf vasprintf waitpid])

## ----------------------------------------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions tools/test/perform/iopipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ print_stats(const char *prefix,
static void
synchronize(void)
{
#ifdef H5_HAVE_SYSTEM
#if defined(H5_HAVE_WIN32_API) && !defined(__CYGWIN__)
_flushall();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I'm aware, this only flushes FILE objects, so it's not the same as POSIX's sync(2) and is probably the wrong thing to do here. FlushFileBuffers() would be better, but that requires the file's HANDLE.

#else
Expand All @@ -107,7 +106,6 @@ synchronize(void)
status = HDsystem("df >/dev/null");
HDassert(status >= 0);
#endif
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear why we're not using sync(2) here instead of system("sync"). Also unclear what the df hack is supposed to be doing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ancient testcode - not certain either, except that a system sync will flush data from all processes.

#endif
}

/*-------------------------------------------------------------------------
Expand Down