From 7f7135dc1b2900725dd18b353c60c937d27a6f89 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 2 Mar 2026 17:37:19 +0100 Subject: [PATCH] Fix the interpretation of the return value of smartctl in Windows --- cmdline/mingw.c | 2 +- cmdline/unix.h | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/cmdline/mingw.c b/cmdline/mingw.c index 728e8b29..df9d55ba 100644 --- a/cmdline/mingw.c +++ b/cmdline/mingw.c @@ -2820,7 +2820,7 @@ retry: /* store the smartctl return value */ if (smart) - smart[SMART_FLAGS].raw = WEXITSTATUS(ret); + smart[SMART_FLAGS].raw = ret; } return 0; diff --git a/cmdline/unix.h b/cmdline/unix.h index 2784a4e3..168ac862 100644 --- a/cmdline/unix.h +++ b/cmdline/unix.h @@ -18,13 +18,6 @@ #ifndef __UNIX_H #define __UNIX_H -#ifndef WEXITSTATUS -#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) -#endif -#ifndef WIFEXITED -#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) -#endif - #ifdef __linux__ #define HAVE_LINUX_DEVICE 1 /**< In Linux enables special device support. */ #define HAVE_DIRECT_IO 1 /**< Support O_DIRECT in open(). */