fix various compiler warnings

Change-Id: I65a862132563f578eff11b8d085960b820f5d4b7
diff --git a/src/storage.c b/src/storage.c
index bcb50a2..ddbadd0 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -66,6 +66,7 @@
 int e1frame_store(struct e1inp_ts *ts, struct msgb *msg, enum osmo_e1cap_capture_mode mode)
 {
 	struct osmo_e1cap_pkthdr _h, *h = &_h;
+	struct timeval tv;
 	int rc;
 	struct iovec iov[2] = {
 		{
@@ -78,7 +79,8 @@
 	};
 
 	h->len = htonl(msg->len);
-	gettimeofday(&h->ts, NULL);
+	tv = h->ts;
+	gettimeofday(&tv, NULL);
 	h->line_nr = ts->line->num;
 	h->ts_nr = ts->num;
 	h->capture_mode = mode;