git://git.onelab.eu
/
util-vserver-pl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a4750b9
)
support reading of negative numbers for rlimit values
author
Marc Fiuczynski
<mef@cs.princeton.edu>
Thu, 30 Oct 2008 06:13:37 +0000
(06:13 +0000)
committer
Marc Fiuczynski
<mef@cs.princeton.edu>
Thu, 30 Oct 2008 06:13:37 +0000
(06:13 +0000)
src/planetlab.c
patch
|
blob
|
history
diff --git
a/src/planetlab.c
b/src/planetlab.c
index
90ba4dd
..
db9c430
100644
(file)
--- a/
src/planetlab.c
+++ b/
src/planetlab.c
@@
-356,8
+356,13
@@
pl_get_limits(const char *context, struct sliver_resources *slr)
buf[len-1]='\0';
len --;
}
buf[len-1]='\0';
len --;
}
- if ( (r->type == TYPE_LONG) && isdigit(*buf)) {
- *r->limit = atoi(buf);
+ if (r->type == TYPE_LONG) {
+ int val;
+ char *res=0;
+ errno=0;
+ val = strtol(buf,&res,0);
+ if ( !( (val==0 && res) || (errno!=0) ) )
+ *r->limit = val;
} else if ( (r->type == TYPE_PERS) && isalpha(*buf)) {
unsigned long int res;
res = vc_str2personalitytype(buf,len);
} else if ( (r->type == TYPE_PERS) && isalpha(*buf)) {
unsigned long int res;
res = vc_str2personalitytype(buf,len);