aboutsummaryrefslogtreecommitdiff
path: root/tools/plink/time.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-11-19 12:14:18 +0000
committermarha <marha@users.sourceforge.net>2010-11-19 12:14:18 +0000
commit6be86147f292b3178413bc644853ad80b620042e (patch)
treed972cbd73289e9b6e9574c5fd65c6830f67861c6 /tools/plink/time.c
parent111cb82886d25b0b7faa526ce411cc8ef02235a6 (diff)
downloadvcxsrv-6be86147f292b3178413bc644853ad80b620042e.tar.gz
vcxsrv-6be86147f292b3178413bc644853ad80b620042e.tar.bz2
vcxsrv-6be86147f292b3178413bc644853ad80b620042e.zip
Reintegrate tools from trunk
Diffstat (limited to 'tools/plink/time.c')
-rw-r--r--tools/plink/time.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/plink/time.c b/tools/plink/time.c
new file mode 100644
index 000000000..d873d44cc
--- /dev/null
+++ b/tools/plink/time.c
@@ -0,0 +1,16 @@
+/*
+ * Portable implementation of ltime() for any ISO-C platform where
+ * time_t behaves. (In practice, we've found that platforms such as
+ * Windows and Mac have needed their own specialised implementations.)
+ */
+
+#include <time.h>
+#include <assert.h>
+
+struct tm ltime(void)
+{
+ time_t t;
+ time(&t);
+ assert (t != ((time_t)-1));
+ return *localtime(&t);
+}