lib: Add include guard to tst_safe_clocks.h
PATCH 1/1 lib: Add include guard to tst_safe_clocks.h
When adding a common header to my tests I missed this include guard when accidentally including tst_safe_clocks.h from .c and .h files. Since other tst_safe_*.h files have guards I thought it would be good to add to this one as well.
--- include/tst_safe_clocks.h | 5 +++++ 1 file changed, 5 insertions(+)
include/tst_safe_clocks.h +5 -0
@@ -5,6 +5,9 @@* Email : [email protected] */ +#ifndef TST_SAFE_CLOCK_H__ +#define TST_SAFE_CLOCK_H__ +#include <time.h> #include <sys/timex.h> #include "tst_test.h"
@@ -69,3 +72,5 @@ static inline void safe_clock_adjtime(const char *file, const int lineno,#define SAFE_CLOCK_ADJTIME (clk_id, txc)\ safe_clock_adjtime(__FILE__, __LINE__, (clk_id), (txc)) + +#endif /* SAFE_CLOCK_H__ */
Signature · 1 line
2.20.1
PATCH 1/1 lib: Add include guard to tst_safe_clocks.h
Quoted 35 lines · Rafael David Tinoco
When adding a common header to my tests I missed this include guard when accidentally including
tst_safe_clocks.hfrom .c and .h files. Since other tst_safe_*.h files have guards I thought it would be good to add to this one as well.Signed-off-by Rafael David Tinoco <[email protected]>---
include/tst_safe_clocks.h| 5 +++++1 file changed, 5 insertions(+)include/tst_safe_clocks.h +5
-0@@ -5,6 +5,9 @@* Email : [email protected] */ +#ifndef TST_SAFE_CLOCK_H__ +#define TST_SAFE_CLOCK_H__ +#include <time.h> #include <sys/timex.h> #include "tst_test.h" @@ -69,3 +72,5 @@ static inline void safe_clock_adjtime(const char *file, const int lineno,#define SAFE_CLOCK_ADJTIME (clk_id, txc)\ safe_clock_adjtime(__FILE__, __LINE__, (clk_id), (txc)) + +#endif /* SAFE_CLOCK_H__ */ Signature · 1 line
2.20.1
Ack.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190320/9f805ecc/attachment-0001.html>
PATCH 1/1 lib: Add include guard to tst_safe_clocks.h
In reply to Rafael David TinocoHi!
Quoted 4 lines
When adding a common header to my tests I missed this include guard when accidentally including
tst_safe_clocks.hfrom .c and .h files. Since other tst_safe_*.h files have guards I thought it would be good to add to this one as well.
This is obviously OK, but needs to be applied over the CLOCK_ADJTIME patch (it would have been slightly better if it was part of that patchset), I will apply it once the adjtime tests are merged...
Signature · 2 lines
Cyril Hrubis [email protected]