diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-06-16 09:50:52 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-06-16 09:50:52 -0400 |
commit | d1ab295d7b2c4c8bd3da5e1774bc352f8cfe72ab (patch) | |
tree | 921913749ae3025817b8f70b1819004231cbffa1 /src/common/compat.c | |
parent | f986e268505118265fa8fba14a7a5dc1331110c3 (diff) | |
download | tor-d1ab295d7b2c4c8bd3da5e1774bc352f8cfe72ab.tar.gz tor-d1ab295d7b2c4c8bd3da5e1774bc352f8cfe72ab.zip |
add LCOV_EXCL for unreachable exit() blocks in src/common
Diffstat (limited to 'src/common/compat.c')
-rw-r--r-- | src/common/compat.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index 023325bf57..370881b07e 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -2876,18 +2876,22 @@ tor_gettimeofday(struct timeval *timeval) /* number of 100-nsec units since Jan 1, 1601 */ GetSystemTimeAsFileTime(&ft.ft_ft); if (ft.ft_64 < EPOCH_BIAS) { + /* LCOV_EXCL_START */ log_err(LD_GENERAL,"System time is before 1970; failing."); exit(1); + /* LCOV_EXCL_STOP */ } ft.ft_64 -= EPOCH_BIAS; timeval->tv_sec = (unsigned) (ft.ft_64 / UNITS_PER_SEC); timeval->tv_usec = (unsigned) ((ft.ft_64 / UNITS_PER_USEC) % USEC_PER_SEC); #elif defined(HAVE_GETTIMEOFDAY) if (gettimeofday(timeval, NULL)) { + /* LCOV_EXCL_START */ log_err(LD_GENERAL,"gettimeofday failed."); /* If gettimeofday dies, we have either given a bad timezone (we didn't), or segfaulted.*/ exit(1); + /* LCOV_EXCL_STOP */ } #elif defined(HAVE_FTIME) struct timeb tb; |