Migrate Windows smartctl execution from _wpopen to os_popen and direct process spawning

This commit is contained in:
Andrea Mazzoleni 2026-09-14 15:40:54 +02:00
parent 9f48c87dd4
commit c1bcd6a24f
8 changed files with 433 additions and 134 deletions

View file

@ -335,6 +335,11 @@ extern int exit_sync_needed;
*/
#define SMART_MAX 128
/**
* Max smartctl custom option length.
*/
#define SMARTCTL_MAX 512
/**
* Smart ignore structure.
*/
@ -379,8 +384,8 @@ struct devinfo_struct {
uint64_t device; /**< Device ID. */
char name[PATH_MAX]; /**< Name of the disk combined with the split index if any */
char mount[PATH_MAX]; /**< Mount point or other contained directory. */
char smartctl[SMART_MAX]; /**< Custom option for smartctl. Empty means auto. */
char smartctl_info[SMART_MAX]; /* Info options for smartctl. Empty means -a. */
char smartctl[SMARTCTL_MAX]; /**< Custom option for smartctl. Empty means auto. */
char smartctl_info[SMARTCTL_MAX]; /* Info options for smartctl. Empty means -a. */
struct smartignore_struct smartignore[SMART_IGNORE_MAX]; /**< Attributes to ignore */
char file[PATH_MAX]; /**< File device. */
#ifdef _WIN32