patch 9.1.0842: not checking for the sync() systemcall

Commit: 
https://github.com/vim/vim/commit/8bb5eaf019bc46e3b20e1509d88c07655f1632cd
Author: Jonas Sortie Termansen <sor...@maxsi.org>
Date:   Mon Nov 4 20:32:27 2024 +0100

    patch 9.1.0842: not checking for the sync() systemcall
    
    Problem:  not checking for the sync() systemcall
    Solution: check for sync in configure script, fix related #ifdefs
              (Jonas Termansen)
    
    It's better to check for features directly rather than maintaining a
    denylist of operating systems without them.
    
    closes: #15985
    
    Signed-off-by: Jonas 'Sortie' Termansen <sor...@maxsi.org>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/auto/configure b/src/auto/configure
index db8a89ba0..062119e77 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -13642,6 +13642,12 @@ then :
   printf "%s
" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
 
 fi
+ac_fn_c_check_func "$LINENO" "sync" "ac_cv_func_sync"
+if test "x$ac_cv_func_sync" = xyes
+then :
+  printf "%s
" "#define HAVE_SYNC 1" >>confdefs.h
+
+fi
 
 
 
diff --git a/src/config.h.in b/src/config.h.in
index 530c0829f..3ff4605a0 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -209,6 +209,7 @@
 #undef HAVE_CANBERRA
 #undef HAVE_SODIUM
 #undef HAVE_ST_BLKSIZE
+#undef HAVE_SYNC
 #undef HAVE_SYSCONF
 #undef HAVE_SYSCTL
 #undef HAVE_SYSINFO
diff --git a/src/configure.ac b/src/configure.ac
index 24479d386..56895f66a 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -3769,7 +3769,7 @@ AC_CHECK_FUNCS(fchdir fchown fchmod fsync getcwd 
getpseudotty \
        sigprocmask sigvec strcasecmp strcoll strerror strftime stricmp 
strncasecmp \
        strnicmp strpbrk strptime strtol tgetent towlower towupper iswupper \
        tzset usleep utime utimes mblen ftruncate unsetenv posix_openpt \
-       clock_gettime)
+       clock_gettime sync)
 AC_FUNC_SELECT_ARGTYPES
 AC_FUNC_FSEEKO
 
diff --git a/src/memfile.c b/src/memfile.c
index abb7c3fb3..4707969f4 100644
--- a/src/memfile.c
+++ b/src/memfile.c
@@ -594,13 +594,10 @@ mf_sync(memfile_T *mfp, int flags)
        }
        else
 # endif
-           // OpenNT is strictly POSIX (Benzinger)
-           // Tandem/Himalaya NSK-OSS doesn't have sync()
-           // No sync() on Stratus VOS
-# if defined(__OPENNT) || defined(__TANDEM) || defined(__VOS__)
-           fflush(NULL);
-# else
+# ifdef HAVE_SYNC
            sync();
+# else
+           fflush(NULL);
 # endif
 #endif
 #ifdef VMS
diff --git a/src/version.c b/src/version.c
index 3c18aa479..7d02e6cf7 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    842,
 /**/
     841,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1t830b-00EEhF-B1%40256bit.org.

Raspunde prin e-mail lui