From 192cd175e7bbea2757c5dd7403c1b5810da697f4 Mon Sep 17 00:00:00 2001 From: ballen4705 <ballen4705@4ea69e1a-61f1-4043-bf83-b5c94c648137> Date: Mon, 25 Nov 2002 11:45:28 +0000 Subject: [PATCH] Some systems don't have WEXITSTATUS macro git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@329 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- sm5/smartd.c | 6 +++++- sm5/smartd.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sm5/smartd.c b/sm5/smartd.c index 3bf4d7cae..0ac0b6636 100644 --- a/sm5/smartd.c +++ b/sm5/smartd.c @@ -47,7 +47,7 @@ // CVS ID strings extern const char *CVSid1, *CVSid2; -const char *CVSid6="$Id: smartd.c,v 1.75 2002/11/25 04:48:01 ballen4705 Exp $" +const char *CVSid6="$Id: smartd.c,v 1.76 2002/11/25 11:45:28 ballen4705 Exp $" CVSID1 CVSID2 CVSID3 CVSID4 CVSID7; // global variable used for control of printing, passing arguments, etc. @@ -198,7 +198,11 @@ void printandmail(cfgfile *cfg, int which, int priority, char *fmt, ...){ // issue the command to send email status=system(command); +#ifdef WEXITSTATUS if (WEXITSTATUS(status)) +#else + if (status) +#endif printout(LOG_CRIT,"Email warning message to %s failed (32-bit exit status: %d)\n",address,status); else { if (which) diff --git a/sm5/smartd.cpp b/sm5/smartd.cpp index e40bd5409..0e7336e9e 100644 --- a/sm5/smartd.cpp +++ b/sm5/smartd.cpp @@ -47,7 +47,7 @@ // CVS ID strings extern const char *CVSid1, *CVSid2; -const char *CVSid6="$Id: smartd.cpp,v 1.75 2002/11/25 04:48:01 ballen4705 Exp $" +const char *CVSid6="$Id: smartd.cpp,v 1.76 2002/11/25 11:45:28 ballen4705 Exp $" CVSID1 CVSID2 CVSID3 CVSID4 CVSID7; // global variable used for control of printing, passing arguments, etc. @@ -198,7 +198,11 @@ void printandmail(cfgfile *cfg, int which, int priority, char *fmt, ...){ // issue the command to send email status=system(command); +#ifdef WEXITSTATUS if (WEXITSTATUS(status)) +#else + if (status) +#endif printout(LOG_CRIT,"Email warning message to %s failed (32-bit exit status: %d)\n",address,status); else { if (which) -- GitLab