The function scan_shares_files() modifies a global variable, which in the
current way was confusing, so passing the variable as argument.
Signed-off-by: Sudhir Kumar <[EMAIL PROTECTED]>
Index: ltp-full-20081031/testcases/kernel/controllers/cpuctl/cpuctl_test01.c
===================================================================
--- ltp-full-20081031.orig/testcases/kernel/controllers/cpuctl/cpuctl_test01.c
+++ ltp-full-20081031/testcases/kernel/controllers/cpuctl/cpuctl_test01.c
@@ -154,7 +154,7 @@ int main(int argc, char* argv[])
if (!strncpy (fullpath, path, len))
tst_brkm (TBROK, cleanup, "Could not copy directory path %s ",
path);
- if (scan_shares_files() != 0)
+ if (scan_shares_files(shares_pointer) != 0)
tst_brkm (TBROK, cleanup, "From function scan_shares_files in
%s ", fullpath);
/* return val: -1 in case of function error, else 2 is min share value
*/
Index:
ltp-full-20081031/testcases/kernel/controllers/libcontrollers/libcontrollers.c
===================================================================
---
ltp-full-20081031.orig/testcases/kernel/controllers/libcontrollers/libcontrollers.c
+++
ltp-full-20081031/testcases/kernel/controllers/libcontrollers/libcontrollers.c
@@ -41,7 +41,7 @@
* of the controller and returns the total added shares of all
* the groups (currently excludes default group) ??
*/
-int scan_shares_files ()
+int scan_shares_files(unsigned int *shares_pointer)
{
struct stat statbuffer;
DIR *dp;
@@ -90,7 +90,7 @@ int scan_shares_files ()
FLAG = 1;
strcpy (path_pointer, dir_pointer->d_name ); /* append name to
fullpath */
- if ((retval = scan_shares_files()) != 0)
+ if ((retval = scan_shares_files(shares_pointer)) != 0)
break;
}
Index:
ltp-full-20081031/testcases/kernel/controllers/libcontrollers/libcontrollers.h
===================================================================
---
ltp-full-20081031.orig/testcases/kernel/controllers/libcontrollers/libcontrollers.h
+++
ltp-full-20081031/testcases/kernel/controllers/libcontrollers/libcontrollers.h
@@ -75,7 +75,7 @@ unsigned int read_shares_file (char *fil
int read_file(char *filepath, int action, unsigned int *value);
-int scan_shares_files ();
+int scan_shares_files(unsigned int *shares_pointer);
int write_to_file (char * file, const char* mode, unsigned int value);
Index: ltp-full-20081031/testcases/kernel/controllers/cpuctl/cpuctl_test02.c
===================================================================
--- ltp-full-20081031.orig/testcases/kernel/controllers/cpuctl/cpuctl_test02.c
+++ ltp-full-20081031/testcases/kernel/controllers/cpuctl/cpuctl_test02.c
@@ -166,7 +166,7 @@ int main(int argc, char* argv[])
if (!strncpy (fullpath, path, len))
tst_brkm (TBROK, cleanup, "Could not copy directory path %s ",
path);
- if (scan_shares_files() != 0)
+ if (scan_shares_files(shares_pointer) != 0)
tst_brkm (TBROK, cleanup, "From function scan_shares_files in
%s ", fullpath);
/* return val: -1 in case of function error, else 2 is min share value
*/
Index: ltp-full-20081031/testcases/kernel/controllers/cpuctl/cpuctl_test03.c
===================================================================
--- ltp-full-20081031.orig/testcases/kernel/controllers/cpuctl/cpuctl_test03.c
+++ ltp-full-20081031/testcases/kernel/controllers/cpuctl/cpuctl_test03.c
@@ -164,7 +164,7 @@ int main(int argc, char* argv[])
if (!strncpy (fullpath, path, len))
tst_brkm (TBROK, cleanup, "Could not copy directory path %s ",
path);
- if (scan_shares_files() != 0)
+ if (scan_shares_files(shares_pointer) != 0)
tst_brkm (TBROK, cleanup, "From function scan_shares_files in
%s ", fullpath);
/* return val: -1 in case of function error, else 2 is min share value
*/
Index: ltp-full-20081031/testcases/kernel/controllers/cpuctl/cpuctl_test04.c
===================================================================
--- ltp-full-20081031.orig/testcases/kernel/controllers/cpuctl/cpuctl_test04.c
+++ ltp-full-20081031/testcases/kernel/controllers/cpuctl/cpuctl_test04.c
@@ -167,7 +167,7 @@ int main(int argc, char* argv[])
if (!strncpy (fullpath, path, len))
tst_brkm (TBROK, cleanup, "Could not copy directory path %s ",
path);
- if (scan_shares_files() != 0)
+ if (scan_shares_files(shares_pointer) != 0)
tst_brkm (TBROK, cleanup, "From function scan_shares_files in
%s ", fullpath);
/* return val: -1 in case of function error, else 2 is min share value
*/
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list