]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: Removed duplication of unixdate2str().
authorTimo Sirainen <tss@iki.fi>
Sat, 20 Feb 2010 07:24:48 +0000 (09:24 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 20 Feb 2010 07:24:48 +0000 (09:24 +0200)
--HG--
branch : HEAD

src/doveadm/doveadm-dump-index.c
src/doveadm/doveadm-dump-mailboxlog.c
src/doveadm/doveadm.c
src/doveadm/doveadm.h

index 3f47265b56b8f97abebc0a3027be4e5e4520f726..25fad3e6e8c6704c1714d0809d8fd254e3df302e 100644 (file)
@@ -61,16 +61,6 @@ struct dbox_mail_index_map_record {
        uint32_t size;
 };
 
-static const char *unixdate2str(time_t timestamp)
-{
-       static char buf[64];
-       struct tm *tm;
-
-       tm = localtime(&timestamp);
-       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;
index 08c6461ae0907c7b04eccb962900ea7e2696fc34..59dcf3038f14b3e5548e0ca655681a79753f2f75 100644 (file)
 #include <fcntl.h>
 #include <time.h>
 
-static const char *unixdate2str(time_t timestamp)
-{
-       static char buf[64];
-       struct tm *tm;
-
-       tm = localtime(&timestamp);
-       strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm);
-       return buf;
-}
-
 static int dump_record(int fd)
 {
        off_t offset;
index 1db0a132d71432c978f9c134aad0adc34864f1a8..5bac41aa6b77befd7539e654937def8c5bef3de6 100644 (file)
@@ -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 @@ void help(const struct doveadm_cmd *cmd)
        exit(0);
 }
 
+const char *unixdate2str(time_t timestamp)
+{
+       static char buf[64];
+       struct tm *tm;
+
+       tm = localtime(&timestamp);
+       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;
index 800d02732b2e90e6bb2a4c43c1cc2f89f93eacab..4ee48f7ccdfa783622b2ec8c87de91b9ce959a80 100644 (file)
@@ -25,4 +25,6 @@ void doveadm_register_cmd(const struct doveadm_cmd *cmd);
 void usage(void);
 void help(const struct doveadm_cmd *cmd);
 
+const char *unixdate2str(time_t timestamp);
+
 #endif