Switch to unified view

a/src/internfile/mh_mbox.cpp b/src/internfile/mh_mbox.cpp
...
...
16
 */
16
 */
17
#ifndef TEST_MH_MBOX
17
#ifndef TEST_MH_MBOX
18
#include "autoconfig.h"
18
#include "autoconfig.h"
19
19
20
#include <stdio.h>
20
#include <stdio.h>
21
#include <fcntl.h>
22
#include <errno.h>
21
#include <errno.h>
23
#include <unistd.h>
22
#include <sys/types.h>
23
#include "safesysstat.h"
24
#include <time.h>
24
#include <time.h>
25
#include <regex.h>
25
#include <regex.h>
26
#include <sys/stat.h>
27
#include <errno.h>
28
26
29
#include <cstring>
27
#include <cstring>
30
#include <map>
28
#include <map>
31
29
32
#include "cstr.h"
30
#include "cstr.h"
...
...
270
#if defined O_NOATIME && O_NOATIME != 0
268
#if defined O_NOATIME && O_NOATIME != 0
271
    if (fcntl(fileno((FILE *)m_vfp), F_SETFL, O_NOATIME) < 0) {
269
    if (fcntl(fileno((FILE *)m_vfp), F_SETFL, O_NOATIME) < 0) {
272
        // perror("fcntl");
270
        // perror("fcntl");
273
    }
271
    }
274
#endif
272
#endif
275
    fseek((FILE *)m_vfp, 0, SEEK_END);
273
    // Used to use ftell() here: no good beyond 2GB
276
    m_fsize = ftell((FILE*)m_vfp);
274
    {struct stat st;
277
    fseek((FILE*)m_vfp, 0, SEEK_SET);
275
  if (fstat(fileno((FILE*)m_vfp), &st) < 0) {
276
      LOGERR(("MimeHandlerMbox:setdocfile: fstat(%s) failed errno %d\n",
277
          fn.c_str(), errno));
278
      return false;
279
  }
280
  m_fsize = st.st_size;
281
    }
278
    m_havedoc = true;
282
    m_havedoc = true;
279
    m_offsets.clear();
283
    m_offsets.clear();
280
    m_quirks = 0;
284
    m_quirks = 0;
281
285
282
    // Check for location-based quirks:
286
    // Check for location-based quirks: