about summary refs log tree commit diff
path: root/resolv
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-02-18 13:44:48 +0100
committerFlorian Weimer <fweimer@redhat.com>2020-02-18 13:44:48 +0100
commit631cf64bc1d8306e011ef39f60b8cb6de91bd271 (patch)
tree719100a2b1098d6921ef74397b681de93efcfa95 /resolv
parentfa185f0d4529c6d70f690306f431ca23662b9138 (diff)
downloadglibc-631cf64bc1d8306e011ef39f60b8cb6de91bd271.tar.gz
glibc-631cf64bc1d8306e011ef39f60b8cb6de91bd271.tar.xz
glibc-631cf64bc1d8306e011ef39f60b8cb6de91bd271.zip
Move implementation of <file_change_detection.h> into a C file
file_change_detection_for_stat partially initialize
struct file_change_detection in some cases, when the size member
alone determines the outcome of all comparisons.  This results
in maybe-uninitialized compiler warnings in case of sufficiently
aggressive inlining.

Once the implementation is moved into a separate C file, this kind
of inlining is no longer possible, so the compiler warnings are gone.
Diffstat (limited to 'resolv')
-rw-r--r--resolv/res_init.c2
-rw-r--r--resolv/resolv_conf.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/resolv/res_init.c b/resolv/res_init.c
index 98d84f264d..ee5dfdd391 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -583,7 +583,7 @@ __resolv_conf_load (struct __res_state *preinit,
   if (ok && change != NULL)
     /* Update the file change information if the configuration was
        loaded successfully.  */
-    ok = file_change_detection_for_fp (change, fp);
+    ok = __file_change_detection_for_fp (change, fp);
 
   if (ok)
     {
diff --git a/resolv/resolv_conf.c b/resolv/resolv_conf.c
index 29a1f4fb94..286149ffad 100644
--- a/resolv/resolv_conf.c
+++ b/resolv/resolv_conf.c
@@ -121,7 +121,7 @@ struct resolv_conf *
 __resolv_conf_get_current (void)
 {
   struct file_change_detection initial;
-  if (!file_change_detection_for_path (&initial, _PATH_RESCONF))
+  if (!__file_change_detection_for_path (&initial, _PATH_RESCONF))
     return NULL;
 
   struct resolv_conf_global *global_copy = get_locked_global ();
@@ -129,7 +129,7 @@ __resolv_conf_get_current (void)
     return NULL;
   struct resolv_conf *conf;
   if (global_copy->conf_current != NULL
-      && file_is_unchanged (&initial, &global_copy->file_resolve_conf))
+      && __file_is_unchanged (&initial, &global_copy->file_resolve_conf))
     /* We can reuse the cached configuration object.  */
     conf = global_copy->conf_current;
   else
@@ -149,7 +149,7 @@ __resolv_conf_get_current (void)
              /etc/resolv.conf is temporarily replaced while the file
              is read (after the initial measurement), and restored to
              the initial version later.  */
-          if (file_is_unchanged (&initial, &after_load))
+          if (__file_is_unchanged (&initial, &after_load))
             global_copy->file_resolve_conf = after_load;
           else
             /* If there is a discrepancy, trigger a reload during the