[Git][NTPsec/ntpsec][master] Reduce the visibility of an initialization latch.

Eric S. Raymond gitlab at mg.gitlab.com
Sat Jul 16 10:54:26 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
1159155d by Eric S. Raymond at 2016-07-16T06:53:52-04:00
Reduce the visibility of an initialization latch.

- - - - -


2 changed files:

- include/lib_strbuf.h
- libntp/lib_strbuf.c


Changes:

=====================================
include/lib_strbuf.h
=====================================
--- a/include/lib_strbuf.h
+++ b/include/lib_strbuf.h
@@ -16,8 +16,6 @@
 typedef char libbufstr[LIB_BUFLENGTH];
 extern libbufstr lib_stringbuf[LIB_NUMBUF];
 extern int lib_nextbuf;
-extern bool lib_inited;
-
 
 /*
  * Macro to get a pointer to the next buffer


=====================================
libntp/lib_strbuf.c
=====================================
--- a/libntp/lib_strbuf.c
+++ b/libntp/lib_strbuf.c
@@ -19,7 +19,6 @@ libbufstr	lib_stringbuf[LIB_NUMBUF];
 int		lib_nextbuf;
 bool		ipv4_works;
 bool		ipv6_works;
-bool		lib_inited;
 
 
 /*
@@ -28,6 +27,8 @@ bool		lib_inited;
 void
 init_lib(void)
 {
+	static bool		lib_inited;
+
 	if (lib_inited)
 		return;
 	ipv4_works = (ISC_R_SUCCESS == isc_net_probeipv4());



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/1159155d57609b6b8ca535b40a316a98ec3b88c9
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160716/131785e1/attachment.html>


More information about the vc mailing list