aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-28 21:00:38 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-28 21:00:38 +0400
commit37d6c7f23fd44283d1853141d39ecc3f3a2c54e6 (patch)
treecaa5cbe2aaca2fb09886d43aeb77dbe2c160c553 /src/util.h
parent99225e6499d32f2415f64cd9d5d4402d3fb78b30 (diff)
downloadrspamd-37d6c7f23fd44283d1853141d39ecc3f3a2c54e6.tar.gz
rspamd-37d6c7f23fd44283d1853141d39ecc3f3a2c54e6.zip
* Add more timeouts: for fuzzy operations, for worker task operations
Handle miliseconds using a common macro.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 2ba01d05e..f4eea0bd6 100644
--- a/src/util.h
+++ b/src/util.h
@@ -173,4 +173,9 @@ const gchar * process_to_str (enum process_type type);
*/
enum process_type str_to_process (const gchar *str);
+/*
+ * Convert milliseconds to timeval fields
+ */
+#define msec_to_tv(msec, tv) do { (tv)->tv_sec = (msec) / 1000; (tv)->tv_usec = ((msec) - (tv)->tv_sec * 1000) * 1000; } while(0)
+
#endif