diff --git a/sm5/smartd.c b/sm5/smartd.c
index 3bf4d7cae978a92b250e61d7c54ca03f399b3f54..0ac0b66366292446b9e8bd94d48e8f0b4033f51d 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 e40bd54090f388c0bb2d81474a8319b334e30e5d..0e7336e9e0cb26af1c5b95d70e42dcf31316fa1c 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)