chiark / gitweb /
logging: reduce send timeout to something more sensible
[elogind.git] / src / shared / time-util.c
index 678fd588b203e73a567f4e1ef5e0756ffa01bd06..faa3418819e81dfe4e526966bac34554425cad68 100644 (file)
@@ -142,12 +142,11 @@ struct timeval *timeval_store(struct timeval *tv, usec_t u) {
         if (u == (usec_t) -1) {
                 tv->tv_sec = (time_t) -1;
                 tv->tv_usec = (suseconds_t) -1;
-                return tv;
+        } else {
+                tv->tv_sec = (time_t) (u / USEC_PER_SEC);
+                tv->tv_usec = (suseconds_t) (u % USEC_PER_SEC);
         }
 
-        tv->tv_sec = (time_t) (u / USEC_PER_SEC);
-        tv->tv_usec = (suseconds_t) (u % USEC_PER_SEC);
-
         return tv;
 }