diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2011-11-25 20:18:52 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2011-11-25 20:18:52 +0800 |
commit | 59114c5fad044272819e6cfb8dc8cfa0f78edd5d (patch) | |
tree | a5c3b8ccbaa1c515bb669a371c31bbb64662b6d7 | |
parent | 24020ab34138c18d412d05f337f552013a609a88 (diff) | |
download | pttbbs-59114c5fad044272819e6cfb8dc8cfa0f78edd5d.tar pttbbs-59114c5fad044272819e6cfb8dc8cfa0f78edd5d.tar.gz pttbbs-59114c5fad044272819e6cfb8dc8cfa0f78edd5d.tar.bz2 pttbbs-59114c5fad044272819e6cfb8dc8cfa0f78edd5d.tar.lz pttbbs-59114c5fad044272819e6cfb8dc8cfa0f78edd5d.tar.xz pttbbs-59114c5fad044272819e6cfb8dc8cfa0f78edd5d.tar.zst pttbbs-59114c5fad044272819e6cfb8dc8cfa0f78edd5d.zip |
early return if append failed.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5471 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/record.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pttbbs/mbbsd/record.c b/pttbbs/mbbsd/record.c index bba0fd79..4e73fe6f 100644 --- a/pttbbs/mbbsd/record.c +++ b/pttbbs/mbbsd/record.c @@ -499,9 +499,12 @@ append_record_forward(char *fpath, fileheader_t * record, int size, const char * int n; char address[64] = ""; char fwd_title[STRLEN] = ""; + int r; - // No matter what, append it. - append_record(fpath, record, size); + // No matter what, append it, and return if that failed. + r = append_record(fpath, record, size); + if (r != 0) + return r; // #ifdef USE_MAIL_AUTO_FORWARD @@ -523,6 +526,8 @@ append_record_forward(char *fpath, fileheader_t * record, int size, const char * strip_blank(address, address); if (get_num_records(fpath, sizeof(fileheader_t)) > MAX_KEEPMAIL_HARDLIMIT) { + unlink(buf); + // TODO add a mail so that origid knows what happened. #ifdef USE_LOG_INTERNETMAIL log_filef("log/internet_mail.log", LOG_CREAT, "%s [%s] (%s -> %s) mailbox overflow (%d > %d)\n", |