From 15c54e44d457673734e988e6ee63df3b24f8d7b7 Mon Sep 17 00:00:00 2001 From: piaip Date: Thu, 18 Jun 2009 00:15:37 +0000 Subject: * check the real return value of forked emaildb checking process git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4653 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/emaildb.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mbbsd/emaildb.c') 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 -- cgit v1.2.3