summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/emaildb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mbbsd/emaildb.c b/mbbsd/emaildb.c
index 4cadffca..0909f466 100644
--- a/mbbsd/emaildb.c
+++ b/mbbsd/emaildb.c
@@ -41,7 +41,9 @@ int emaildb_check_email(char * email, int email_len)
default:
waitpid(pid, &count, 0);
- count = WEXITSTATUS(count);
+ // 0xFF: the limitation of WEXISTSTATUS
+ if (WIFEXITED(count) && WEXITSTATUS(count) < 0xFF)
+ count = WEXITSTATUS(count);
// vmsgf(ANSI_RESET "found %d emails", count);
return count;
}
@@ -112,7 +114,9 @@ int emaildb_update_email(char * userid, int userid_len, char * email, int email_
default:
waitpid(pid, &ret, 0);
- ret = WEXITSTATUS(ret);
+ // 0xFF: the limitation of WEXISTSTATUS
+ if (WIFEXITED(ret) && WEXITSTATUS(ret) < 0xFF)
+ ret = WEXITSTATUS(ret);
return ret;
}
#endif