1
0
forked from aniani/vim

patch 8.2.3114: Amiga-like systems: build error using stat()

Problem:    Amiga-like systems: build error using stat().
Solution:   Only build swapfile_process_running() on systems where it is
            actually used. (Ola Söder, closes #8519)
This commit is contained in:
=?UTF-8?q?Ola=20S=C3=B6der?=
2021-07-06 20:15:46 +02:00
committed by Bram Moolenaar
parent 442b29c968
commit 599a6e5b36
2 changed files with 8 additions and 4 deletions

View File

@@ -1104,6 +1104,7 @@ add_b0_fenc(
# include <sys/sysinfo.h> # include <sys/sysinfo.h>
#endif #endif
#if defined(UNIX) || defined(MSWIN)
/* /*
* Return TRUE if the process with number "b0p->b0_pid" is still running. * Return TRUE if the process with number "b0p->b0_pid" is still running.
* "swap_fname" is the name of the swap file, if it's from before a reboot then * "swap_fname" is the name of the swap file, if it's from before a reboot then
@@ -1112,7 +1113,7 @@ add_b0_fenc(
static int static int
swapfile_process_running(ZERO_BL *b0p, char_u *swap_fname UNUSED) swapfile_process_running(ZERO_BL *b0p, char_u *swap_fname UNUSED)
{ {
#ifdef HAVE_SYSINFO_UPTIME # ifdef HAVE_SYSINFO_UPTIME
stat_T st; stat_T st;
struct sysinfo sinfo; struct sysinfo sinfo;
@@ -1121,14 +1122,15 @@ swapfile_process_running(ZERO_BL *b0p, char_u *swap_fname UNUSED)
if (mch_stat((char *)swap_fname, &st) != -1 if (mch_stat((char *)swap_fname, &st) != -1
&& sysinfo(&sinfo) == 0 && sysinfo(&sinfo) == 0
&& st.st_mtime < time(NULL) - ( && st.st_mtime < time(NULL) - (
# ifdef FEAT_EVAL # ifdef FEAT_EVAL
override_sysinfo_uptime >= 0 ? override_sysinfo_uptime : override_sysinfo_uptime >= 0 ? override_sysinfo_uptime :
# endif # endif
sinfo.uptime)) sinfo.uptime))
return FALSE; return FALSE;
#endif # endif
return mch_process_running(char_to_long(b0p->b0_pid)); return mch_process_running(char_to_long(b0p->b0_pid));
} }
#endif
/* /*
* Try to recover curbuf from the .swp file. * Try to recover curbuf from the .swp file.

View File

@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
3114,
/**/ /**/
3113, 3113,
/**/ /**/