Hi,
This patch fixes mmapstress04 test case by obtaining default settings from
default page size. It also preserve the possibility to use user-specified
arguments.
Signed-off-by: CAI Qian <[EMAIL PROTECTED]>
--- ./testcases/kernel/mem/mmapstress/mmapstress04.c.orig 2008-12-10
13:38:06.126136264 +0800
+++ testcases/kernel/mem/mmapstress/mmapstress04.c 2008-12-11
13:15:30.560136673 +0800
@@ -122,17 +122,23 @@
off_t mapoff;
#endif /* LARGE_FILE */
- if (argc != 3) {
+ if (argc < 2 || argc > 3) {
(void)fprintf(stderr, "Usage: %s filename startoffset\n",
argv[0]);
return 1;
}
filename = argv[1];
+
+ if (argc >= 3) {
#ifdef LARGE_FILE
- startoffset = atoll(argv[2]);
+ startoffset = atoll(argv[2]);
#else /* LARGE_FILE */
- startoffset = atoi(argv[2]);
+ startoffset = atoi(argv[2]);
#endif /* LARGE_FILE */
+ }
+ else
+ startoffset = pagesize;
+
if (startoffset % pagesize != 0) {
fprintf(stderr, "pagesize=%ld\n", (long)pagesize);
fprintf(stderr, "startoffset must be a pagesize multiple\n");
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list