diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-08-08 08:24:17 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-08-08 09:06:22 -0400 | 
| commit | 99a6a31e5093159c75d950b8b6f30116a6152ac0 (patch) | |
| tree | f5f9733c85d14f76579333fd65222a324a565eb4 /lib/monotime.h | |
| parent | 00857b241e6c27efad54a19b4226c37f04d80bf5 (diff) | |
*: Define the number of seconds in a Day, Week and year
The defines:
ONE_DAY_SECOND
ONE_WEEK_SECOND
ONE_YEAR_SECOND
were being defined all over the system, move the
define to a central location.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/monotime.h')
| -rw-r--r-- | lib/monotime.h | 4 | 
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/monotime.h b/lib/monotime.h index 7bd3386498..8e50c1874a 100644 --- a/lib/monotime.h +++ b/lib/monotime.h @@ -49,6 +49,10 @@ static inline time_t monotime(struct timeval *tvo)  	return ts.tv_sec;  } +#define ONE_DAY_SECOND 60*60*24 +#define ONE_WEEK_SECOND ONE_DAY_SECOND*7 +#define ONE_YEAR_SECOND ONE_DAY_SECOND*365 +  /* the following two return microseconds, not time_t!   *   * also, they're negative forms of each other, but having both makes the  | 
