Fix the interpretation of the return value of smartctl in Windows

This commit is contained in:
Andrea Mazzoleni 2026-03-02 17:37:19 +01:00
parent b3879f7f8e
commit 7f7135dc1b
2 changed files with 1 additions and 8 deletions

View file

@ -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;

View file

@ -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(). */