From 4a183003a043825f128884f8fedd92026011b27b Mon Sep 17 00:00:00 2001 From: Craig Small Date: Tue, 31 May 2022 20:41:30 +1000 Subject: [PATCH] library: Cygwin doesnt have /proc/vmstat Make the vmstat_read_failed() return non-error for Cygwin as it always will error because /proc/vmstat doesn't exist. Patch from Achim of the Cygwin project. Signed-off-by: Craig Small --- proc/vmstat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proc/vmstat.c b/proc/vmstat.c index fa6359ab..2a6b9514 100644 --- a/proc/vmstat.c +++ b/proc/vmstat.c @@ -1170,6 +1170,7 @@ static int vmstat_read_failed ( // clear out the soon to be 'current' values memset(&info->hist.new, 0, sizeof(struct vmstat_data)); +#ifndef __CYGWIN__ /* /proc/vmstat does not exist */ if (-1 == info->vmstat_fd && (-1 == (info->vmstat_fd = open(VMSTAT_FILE, O_RDONLY)))) return 1; @@ -1213,7 +1214,7 @@ static int vmstat_read_failed ( break; head = tail + 1; } - +#endif /* !__CYGWIN__ */ return 0; } // end: vmstat_read_failed