diff options
| author | Pranith Kumar K <pranithk@gluster.com> | 2012-11-06 12:19:47 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2012-11-23 23:13:39 -0800 | 
| commit | 76a4afec6e03d15cb442e819f6fe7b94d6f9f487 (patch) | |
| tree | 2b98adca7a192a31e21e6b2d4965aaa80d16403b /libglusterfs/src/common-utils.c | |
| parent | 6dee0e3d99dd3423edc6ad2981733fac3ef8c67d (diff) | |
libglusterfs: Implement float percentage
Change-Id: Ia7ea63471f0bbd74686873f5f6f183475880f1a0
BUG: 839595
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.org/4162
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs/src/common-utils.c')
| -rw-r--r-- | libglusterfs/src/common-utils.c | 7 | 
1 files changed, 3 insertions, 4 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index bf1f03a9a4b..8c18b91a7b4 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -676,11 +676,10 @@ gf_string2time (const char *str, uint32_t *n)          return 0;  } -  int -gf_string2percent (const char *str, uint32_t *n) +gf_string2percent (const char *str, double *n)  { -        unsigned long value = 0; +        double value = 0;          char *tail = NULL;          int old_errno = 0;          const char *s = NULL; @@ -701,7 +700,7 @@ gf_string2percent (const char *str, uint32_t *n)          old_errno = errno;          errno = 0; -        value = strtol (str, &tail, 0); +        value = strtod (str, &tail);          if (errno == ERANGE || errno == EINVAL)                  return -1;  | 
