This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.24-657-gf3bef6a


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  f3bef6a748097d02d196df247f7b292c7b83744c (commit)
      from  aee47c934e6b6256f58a3d75815a43fc33237a80 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f3bef6a748097d02d196df247f7b292c7b83744c

commit f3bef6a748097d02d196df247f7b292c7b83744c
Author: DJ Delorie <dj@delorie.com>
Date:   Fri Jan 20 19:52:52 2017 -0500

    * elf/dl-tunables.c (tunable_set_val_if_valid_range): Split into ...
    (tunable_set_val_if_valid_range_signed) ... this, and ...
    (tunable_set_val_if_valid_range_unsigned) ... this.
    (tunable_initialize): Call the correct one of the above based on type.

diff --git a/ChangeLog b/ChangeLog
index a113ad8..1518c7f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-01-20  DJ Delorie  <dj@redhat.com>
+
+	* elf/dl-tunables.c (tunable_set_val_if_valid_range): Split into ...
+	(tunable_set_val_if_valid_range_signed) ... this, and ...
+	(tunable_set_val_if_valid_range_unsigned) ... this.
+	(tunable_initialize): Call the correct one of the above based on type.
+
 2017-01-20  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/hppa/fpu/libm-test-ulps: Remove *_tonearest entries.
diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c
index ba5246a..cbf4c8e 100644
--- a/elf/dl-tunables.c
+++ b/elf/dl-tunables.c
@@ -172,10 +172,10 @@ tunables_strtoul (const char *nptr)
    explicit constraints of the tunable or with the implicit constraints of its
    type.  */
 static void
-tunable_set_val_if_valid_range (tunable_t *cur, const char *strval,
+tunable_set_val_if_valid_range_signed (tunable_t *cur, const char *strval,
 				int64_t default_min, int64_t default_max)
 {
-  int64_t val = tunables_strtoul (strval);
+  int64_t val = (int64_t) tunables_strtoul (strval);
 
   int64_t min = cur->type.min;
   int64_t max = cur->type.max;
@@ -193,6 +193,28 @@ tunable_set_val_if_valid_range (tunable_t *cur, const char *strval,
     }
 }
 
+static void
+tunable_set_val_if_valid_range_unsigned (tunable_t *cur, const char *strval,
+					 uint64_t default_min, uint64_t default_max)
+{
+  uint64_t val = (uint64_t) tunables_strtoul (strval);
+
+  uint64_t min = cur->type.min;
+  uint64_t max = cur->type.max;
+
+  if (min == max)
+    {
+      min = default_min;
+      max = default_max;
+    }
+
+  if (val >= min && val <= max)
+    {
+      cur->val.numval = val;
+      cur->strval = strval;
+    }
+}
+
 /* Validate range of the input value and initialize the tunable CUR if it looks
    good.  */
 static void
@@ -202,12 +224,12 @@ tunable_initialize (tunable_t *cur, const char *strval)
     {
     case TUNABLE_TYPE_INT_32:
 	{
-	  tunable_set_val_if_valid_range (cur, strval, INT32_MIN, INT32_MAX);
+	  tunable_set_val_if_valid_range_signed (cur, strval, INT32_MIN, INT32_MAX);
 	  break;
 	}
     case TUNABLE_TYPE_SIZE_T:
 	{
-	  tunable_set_val_if_valid_range (cur, strval, 0, SIZE_MAX);
+	  tunable_set_val_if_valid_range_unsigned (cur, strval, 0, SIZE_MAX);
 	  break;
 	}
     case TUNABLE_TYPE_STRING:

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |    7 +++++++
 elf/dl-tunables.c |   30 ++++++++++++++++++++++++++----
 2 files changed, 33 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]