]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0842: not checking for the sync() systemcall v9.1.0842
authorJonas Sortie Termansen <sortie@maxsi.org>
Mon, 4 Nov 2024 19:32:27 +0000 (20:32 +0100)
committerChristian Brabandt <cb@256bit.org>
Mon, 4 Nov 2024 19:36:41 +0000 (20:36 +0100)
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 <sortie@maxsi.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/auto/configure
src/config.h.in
src/configure.ac
src/memfile.c
src/version.c

index db8a89ba037995ebdf7daf454f3299729129034f..062119e7768fdc8d2e4dd8737d6e097d382141eb 100755 (executable)
@@ -13642,6 +13642,12 @@ then :
   printf "%s\n" "#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\n" "#define HAVE_SYNC 1" >>confdefs.h
+
+fi
 
 
 
index 530c0829f0ed9756e88363fcc8acb40d3bfc4dfe..3ff4605a03076074664ee7fc3261531e88518fd4 100644 (file)
 #undef HAVE_CANBERRA
 #undef HAVE_SODIUM
 #undef HAVE_ST_BLKSIZE
+#undef HAVE_SYNC
 #undef HAVE_SYSCONF
 #undef HAVE_SYSCTL
 #undef HAVE_SYSINFO
index 24479d3861bb7d82b68aeb3480660c628ddff24d..56895f66ace2cb0ae77925aae84c315015764c32 100644 (file)
@@ -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
 
index abb7c3fb3f2d1ae2aa541d8df04179470886054e..4707969f467e474f9e74925eb7b64059829d2b3c 100644 (file)
@@ -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
index 3c18aa479cdcb2465ee06c76dbe6fafeed25fa5d..7d02e6cf7d6a0fc2b49b2178006e0691a21d5439 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    842,
 /**/
     841,
 /**/