summaryrefslogtreecommitdiffstats
path: root/tools/ideviceimagemounter.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2011-09-03 02:10:48 +0200
committerGravatar Martin Szulecki2012-03-18 20:40:54 +0100
commitdcb85727c3649c254c985d840aa2efb36f727872 (patch)
tree0f6f551b70bd845f57d5a044915e617a1bd40ac6 /tools/ideviceimagemounter.c
parent6a83ef58a1032e3b336587e2f3a19659ae325c25 (diff)
downloadlibimobiledevice-dcb85727c3649c254c985d840aa2efb36f727872.tar.gz
libimobiledevice-dcb85727c3649c254c985d840aa2efb36f727872.tar.bz2
Completely remove glib dependency.
Diffstat (limited to 'tools/ideviceimagemounter.c')
-rw-r--r--tools/ideviceimagemounter.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/tools/ideviceimagemounter.c b/tools/ideviceimagemounter.c
index 3fb4ac5..b4512f5 100644
--- a/tools/ideviceimagemounter.c
+++ b/tools/ideviceimagemounter.c
@@ -28,8 +28,9 @@
#include <string.h>
#include <getopt.h>
#include <errno.h>
-#include <glib.h>
#include <libgen.h>
+#include <time.h>
+#include <sys/time.h>
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/lockdown.h>
@@ -165,7 +166,7 @@ static void plist_node_to_string(plist_t node)
double d;
uint8_t b;
uint64_t u = 0;
- GTimeVal tv = { 0, 0 };
+ struct timeval tv = { 0, 0 };
plist_type t;
@@ -214,9 +215,23 @@ static void plist_node_to_string(plist_t node)
case PLIST_DATE:
plist_get_date_val(node, (int32_t*)&tv.tv_sec, (int32_t*)&tv.tv_usec);
- s = g_time_val_to_iso8601(&tv);
- printf("%s\n", s);
- free(s);
+ {
+ time_t ti = (time_t)tv.tv_sec;
+ struct tm *btime = localtime(&ti);
+ if (btime) {
+ s = (char*)malloc(24);
+ memset(s, 0, 24);
+ if (strftime(s, 24, "%Y-%m-%dT%H:%M:%SZ", btime) <= 0) {
+ free (s);
+ s = NULL;
+ }
+ }
+ }
+ if (s) {
+ puts(s);
+ free(s);
+ }
+ puts("\n");
break;
case PLIST_ARRAY: