diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2014-08-11 12:06:16 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2014-08-11 12:06:16 +0800 |
commit | 14e409a5b4c912de7804eca7169aaf857b38a0d2 (patch) | |
tree | 45a55b5296f82d3ff71d576a987faf4c3820c31c | |
parent | 401c6f8035744344255ba57ab606507aabb94b3d (diff) | |
download | pttbbs-14e409a5b4c912de7804eca7169aaf857b38a0d2.tar pttbbs-14e409a5b4c912de7804eca7169aaf857b38a0d2.tar.gz pttbbs-14e409a5b4c912de7804eca7169aaf857b38a0d2.tar.bz2 pttbbs-14e409a5b4c912de7804eca7169aaf857b38a0d2.tar.lz pttbbs-14e409a5b4c912de7804eca7169aaf857b38a0d2.tar.xz pttbbs-14e409a5b4c912de7804eca7169aaf857b38a0d2.tar.zst pttbbs-14e409a5b4c912de7804eca7169aaf857b38a0d2.zip |
postd: Fix divide by zero in rebuild.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@6057 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/daemon/postd/rebuild.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pttbbs/daemon/postd/rebuild.c b/pttbbs/daemon/postd/rebuild.c index 4c2946e8..ac0413e8 100644 --- a/pttbbs/daemon/postd/rebuild.c +++ b/pttbbs/daemon/postd/rebuild.c @@ -150,7 +150,9 @@ void rebuild_board(int bid GCC_UNUSED, boardheader_t *bp, int is_remote) } end = time4(NULL); printf(" Total %d entries (%ld bytes, %ldKb/s), Exec: %ds, Sync: %ds\n", - num, output_bytes, output_bytes / (end - start) / 1024, + num, output_bytes, + (end > start) ? output_bytes / (end - start) / 1024 : + output_bytes / 1024, syncpoint - start, end - syncpoint); close(s); } |