diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-18 08:15:37 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-18 08:15:37 +0800 |
commit | 15c54e44d457673734e988e6ee63df3b24f8d7b7 (patch) | |
tree | 3b8bf0ca66ab7c39d8ec8c54e192ff04ce5a95b3 /mbbsd | |
parent | 9edc59a95248b1ef8db38574f4f0b6a8a2cd0e09 (diff) | |
download | pttbbs-15c54e44d457673734e988e6ee63df3b24f8d7b7.tar pttbbs-15c54e44d457673734e988e6ee63df3b24f8d7b7.tar.gz pttbbs-15c54e44d457673734e988e6ee63df3b24f8d7b7.tar.bz2 pttbbs-15c54e44d457673734e988e6ee63df3b24f8d7b7.tar.lz pttbbs-15c54e44d457673734e988e6ee63df3b24f8d7b7.tar.xz pttbbs-15c54e44d457673734e988e6ee63df3b24f8d7b7.tar.zst pttbbs-15c54e44d457673734e988e6ee63df3b24f8d7b7.zip |
* 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
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/emaildb.c | 8 |
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 |