From 61f978c8cdfd075bab4eeb7d38a7aa305cc6c6f5 Mon Sep 17 00:00:00 2001 From: "Alexander S. Aganichev" Date: Sun, 6 May 2001 06:52:34 +0000 Subject: [PATCH] Fixed CrashMail/CrashEcho highwaters suport --- goldlib/gmb3/gmojamm2.cpp | 4 +++- goldlib/gmb3/gmojamm4.cpp | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/goldlib/gmb3/gmojamm2.cpp b/goldlib/gmb3/gmojamm2.cpp index abcf98d..487c7da 100644 --- a/goldlib/gmb3/gmojamm2.cpp +++ b/goldlib/gmb3/gmojamm2.cpp @@ -140,8 +140,10 @@ void JamArea::open_area() { memset(&data->hdrinfo, 0, sizeof(JamHdrInfo)); read(data->fhjhr, &data->hdrinfo, sizeof(JamHdrInfo)); - if(not jamwide->smapihw and (data->fhjhw != -1)) + if(not jamwide->smapihw and (data->fhjhw != -1)) { + lseek(data->fhjhw, 0, SEEK_SET); read(data->fhjhw, &data->highwater, sizeof(long)); + } else data->highwater = -1; diff --git a/goldlib/gmb3/gmojamm4.cpp b/goldlib/gmb3/gmojamm4.cpp index 856aea8..44ffb5d 100644 --- a/goldlib/gmb3/gmojamm4.cpp +++ b/goldlib/gmb3/gmojamm4.cpp @@ -74,8 +74,10 @@ void JamArea::lock() { Path file; sprintf(file, "%s.cmhw", path()); data->fhjhw = ::sopen(file, O_RDWR|O_BINARY, WideSharemode, S_STDRW); } - if(data->fhjhw != -1) + if(data->fhjhw != -1) { + lseek(data->fhjhw, 0, SEEK_SET); read(data->fhjhw, &data->highwater, sizeof(long)); + } else data->highwater = -1; } @@ -439,6 +441,7 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) { else if((data->highwater != -1) and (data->fhjhw != -1)) { if(data->highwater >= __msg->msgno) { data->highwater = __msg->msgno - 1; + lseek(data->fhjhw, 0, SEEK_SET); write(data->fhjhw, &data->highwater, sizeof(long)); } }