Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bonsai test; please ignore
[fs/lustre-release.git]
/
lustre
/
tests
/
checkstat.c
diff --git
a/lustre/tests/checkstat.c
b/lustre/tests/checkstat.c
index
c98d6aa
..
acfdfa8
100644
(file)
--- a/
lustre/tests/checkstat.c
+++ b/
lustre/tests/checkstat.c
@@
-90,15
+90,34
@@
main (int argc, char **argv)
fprintf (stderr, "Can't parse numeric uid %s\n", optarg);
return (1);
}
fprintf (stderr, "Can't parse numeric uid %s\n", optarg);
return (1);
}
- } else {
- struct passwd *pw = getpwnam (optarg);
-
- if (pw == NULL)
+ }else {
+ int i,flag=0;
+ char * temp ;
+ temp = optarg;
+ for(i=0;i<strlen(optarg);i++)
{
{
- fprintf (stderr, "Can't find user %s\n", optarg);
- return (1);
+ if(!isdigit(*temp))
+ {
+ flag=1;
+ break;
+ }
+ else
+ temp++;
+ }
+ if(flag)
+ {
+ struct passwd *pw = getpwnam (optarg);
+
+ if (pw == NULL)
+ {
+ fprintf (stderr, "Can't find user %s\n", optarg);
+ return (1);
+ }
+ uid = pw->pw_uid;
+
}
}
- uid = pw->pw_uid;
+ else
+ uid=(uid_t)atol(optarg);
}
break;
}
break;