summaryrefslogtreecommitdiff
path: root/src/maildir-writecache.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/maildir-writecache.cc')
-rw-r--r--src/maildir-writecache.cc21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/maildir-writecache.cc b/src/maildir-writecache.cc
index 2a51b49..ceb2f81 100644
--- a/src/maildir-writecache.cc
+++ b/src/maildir-writecache.cc
@@ -1,9 +1,10 @@
-/** --------------------------------------------------------------------
+/**
* @file maildir-writecache.cc
* @brief Implementation of the Maildir class.
* @author Andreas Aardal Hanssen
* @date 2002-2005
- * ------------------------------------------------------------------ **/
+ */
+
#include "globals.h"
#include "maildir.h"
@@ -11,9 +12,6 @@
#include <fcntl.h>
#include <unistd.h>
-using namespace ::std;
-
-//------------------------------------------------------------------------
bool Binc::Maildir::writeCache(void)
{
if (readOnly) return true;
@@ -25,7 +23,7 @@ bool Binc::Maildir::writeCache(void)
return false;
}
- string safeName = safename;
+ std::string safeName = safename;
free(safename);
FILE *fp = fdopen(fd, "w");
@@ -35,7 +33,7 @@ bool Binc::Maildir::writeCache(void)
}
if (uidvalidity == 0 || uidnext == 0) {
- uidvalidity = time(0);
+ uidvalidity = time(nullptr);
uidnext = messages.size() + 1;
}
@@ -49,10 +47,9 @@ bool Binc::Maildir::writeCache(void)
(unsigned int)message.getInternalDate(),
message.getSize(),
message.getUnique().c_str());
- vector<string> cflags = message.getCustomFlags();
- for (vector<string>::const_iterator it = cflags.begin(); it != cflags.end(); ++it) {
+ std::vector<std::string> cflags = message.getCustomFlags();
+ for (std::vector<std::string>::const_iterator it = cflags.begin(); it != cflags.end(); ++it)
fprintf(fp, " %s", (*it).c_str());
- }
fprintf(fp, "\n");
}
@@ -67,9 +64,7 @@ bool Binc::Maildir::writeCache(void)
}
int dfd = open(path.c_str(), O_RDONLY);
- if (dfd == -1 || (fsync(fd) && (errno != EROFS || errno != EINVAL)) || close(dfd)) {
- return false;
- }
+ if (dfd == -1 || (fsync(fd) && (errno != EROFS || errno != EINVAL)) || close(dfd)) return false;
return true;
}