[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Mon Jun 22 04:50:04 MDT 2015


The branch, master has been updated
       via  e50bf6d replace: Replace BSD strtoll by wrapping strtoll instead of strtoq
      from  f3798a2 lib/sysquota_linux: Handle the quota flags properly

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e50bf6d537ef09e936d19d6e0bf63f9bbc5d4818
Author: Felix Janda <felix.janda at posteo.de>
Date:   Sun Jun 21 12:03:56 2015 +0200

    replace: Replace BSD strtoll by wrapping strtoll instead of strtoq
    
    When it is detected that strtoll returns EINVAL not only in the case
    that the base is not supported, HAVE_BSD_STRTOLL is declared and
    strtoll is replaced. The current replacement code wraps strtoq in
    order to replace strtoll and errors out when strtoq is missing.
    
    In order to remove this possible error path, we can use strtoll instead
    of strtoq since the code is only used when it is known that strtoll exists.
    
    The fixes a compilation problem on linux systems using musl libc, which
    has a BSD-like strtoll but no strtoq.
    
    Signed-off-by: Felix Janda <felix.janda at posteo.de>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: "Stefan (metze) Metzmacher" <metze at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Mon Jun 22 12:49:10 CEST 2015 on sn-devel-104

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

Summary of changes:
 lib/replace/replace.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/replace/replace.c b/lib/replace/replace.c
index 9fae44a..dccf514 100644
--- a/lib/replace/replace.c
+++ b/lib/replace/replace.c
@@ -518,11 +518,10 @@ long long int rep_strtoll(const char *str, char **endptr, int base)
 }
 #else
 #ifdef HAVE_BSD_STRTOLL
-#ifdef HAVE_STRTOQ
 long long int rep_strtoll(const char *str, char **endptr, int base)
 {
-	long long int nb = strtoq(str, endptr, base);
-	/* In linux EINVAL is only returned if base is not ok */
+	long long int nb = strtoll(str, endptr, base);
+	/* With glibc EINVAL is only returned if base is not ok */
 	if (errno == EINVAL) {
 		if (base == 0 || (base >1 && base <37)) {
 			/* Base was ok so it's because we were not
@@ -534,9 +533,6 @@ long long int rep_strtoll(const char *str, char **endptr, int base)
 	}
 	return nb;
 }
-#else
-#error "You need the strtoq function"
-#endif /* HAVE_STRTOQ */
 #endif /* HAVE_BSD_STRTOLL */
 #endif /* HAVE_STRTOLL */
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list