dovecot-2.0: doveadm: Removed duplication of unixdate2str().
dovecot at dovecot.org
dovecot at dovecot.org
Sat Feb 20 09:46:46 EET 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/e71eb3faa075
changeset: 10776:e71eb3faa075
user: Timo Sirainen <tss at iki.fi>
date: Sat Feb 20 09:24:48 2010 +0200
description:
doveadm: Removed duplication of unixdate2str().
diffstat:
src/doveadm/doveadm-dump-index.c | 10 ----------
src/doveadm/doveadm-dump-mailboxlog.c | 10 ----------
src/doveadm/doveadm.c | 11 +++++++++++
src/doveadm/doveadm.h | 2 ++
4 files changed, 13 insertions(+), 20 deletions(-)
diffs (78 lines):
diff -r 5ee9e82f3b68 -r e71eb3faa075 src/doveadm/doveadm-dump-index.c
--- a/src/doveadm/doveadm-dump-index.c Sat Feb 20 09:10:50 2010 +0200
+++ b/src/doveadm/doveadm-dump-index.c Sat Feb 20 09:24:48 2010 +0200
@@ -61,16 +61,6 @@
uint32_t size;
};
-static const char *unixdate2str(time_t timestamp)
-{
- static char buf[64];
- struct tm *tm;
-
- tm = localtime(×tamp);
- strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm);
- return buf;
-}
-
static void dump_hdr(struct mail_index *index)
{
const struct mail_index_header *hdr = &index->map->hdr;
diff -r 5ee9e82f3b68 -r e71eb3faa075 src/doveadm/doveadm-dump-mailboxlog.c
--- a/src/doveadm/doveadm-dump-mailboxlog.c Sat Feb 20 09:10:50 2010 +0200
+++ b/src/doveadm/doveadm-dump-mailboxlog.c Sat Feb 20 09:24:48 2010 +0200
@@ -10,16 +10,6 @@
#include <fcntl.h>
#include <time.h>
-static const char *unixdate2str(time_t timestamp)
-{
- static char buf[64];
- struct tm *tm;
-
- tm = localtime(×tamp);
- strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm);
- return buf;
-}
-
static int dump_record(int fd)
{
off_t offset;
diff -r 5ee9e82f3b68 -r e71eb3faa075 src/doveadm/doveadm.c
--- a/src/doveadm/doveadm.c Sat Feb 20 09:10:50 2010 +0200
+++ b/src/doveadm/doveadm.c Sat Feb 20 09:24:48 2010 +0200
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <time.h>
bool doveadm_verbose = FALSE, doveadm_debug = FALSE;
@@ -41,6 +42,16 @@
exit(0);
}
+const char *unixdate2str(time_t timestamp)
+{
+ static char buf[64];
+ struct tm *tm;
+
+ tm = localtime(×tamp);
+ strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm);
+ return buf;
+}
+
static void cmd_help(int argc ATTR_UNUSED, char *argv[])
{
const struct doveadm_cmd *cmd;
diff -r 5ee9e82f3b68 -r e71eb3faa075 src/doveadm/doveadm.h
--- a/src/doveadm/doveadm.h Sat Feb 20 09:10:50 2010 +0200
+++ b/src/doveadm/doveadm.h Sat Feb 20 09:24:48 2010 +0200
@@ -25,4 +25,6 @@
void usage(void);
void help(const struct doveadm_cmd *cmd);
+const char *unixdate2str(time_t timestamp);
+
#endif
More information about the dovecot-cvs
mailing list