Signed-off-by: Stanislav kholmanskikh <[email protected]>
Signed-off-by: Stanislav Kholmanskikh <[email protected]>
---
 include/test.h    |    4 ++--
 lib/tst_module.c  |    4 ++--
 lib/tst_run_cmd.c |    6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/test.h b/include/test.h
index 1957148..75a34ab 100644
--- a/include/test.h
+++ b/include/test.h
@@ -225,7 +225,7 @@ long tst_ncpus_max(void);
  * redirection is not needed.
  */
 void tst_run_cmd_fds(void (cleanup_fn)(void),
-                       char *const argv[],
+                       const char *const argv[],
                        int stdout_fd,
                        int stderr_fd);
 
@@ -236,7 +236,7 @@ void tst_run_cmd_fds(void (cleanup_fn)(void),
  * not needed.
  */
 void tst_run_cmd(void (cleanup_fn)(void),
-               char *const argv[],
+               const char *const argv[],
                const char *stdout_path,
                const char *stderr_path);
 
diff --git a/lib/tst_module.c b/lib/tst_module.c
index c0f2c8f..028af0e 100644
--- a/lib/tst_module.c
+++ b/lib/tst_module.c
@@ -85,7 +85,7 @@ void tst_module_load(void (cleanup_fn)(void),
        while (argv && argv[size])
                ++size;
        size += offset;
-       char *mod_argv[size + 1]; /* + NULL in the end */
+       const char *mod_argv[size + 1]; /* + NULL in the end */
        mod_argv[size] = NULL;
        mod_argv[0] = "insmod";
        mod_argv[1] = mod_path;
@@ -100,6 +100,6 @@ void tst_module_load(void (cleanup_fn)(void),
 
 void tst_module_unload(void (cleanup_fn)(void), const char *mod_name)
 {
-       char *const argv[] = { "rmmod", mod_name, NULL };
+       const char *const argv[] = { "rmmod", mod_name, NULL };
        tst_run_cmd(cleanup_fn, argv, NULL, NULL);
 }
diff --git a/lib/tst_run_cmd.c b/lib/tst_run_cmd.c
index 714b508..804103c 100644
--- a/lib/tst_run_cmd.c
+++ b/lib/tst_run_cmd.c
@@ -31,7 +31,7 @@
 #define OPEN_FLAGS     (O_WRONLY | O_APPEND | O_CREAT)
 
 void tst_run_cmd_fds(void (cleanup_fn)(void),
-               char *const argv[],
+               const char *const argv[],
                int stdout_fd,
                int stderr_fd)
 {
@@ -57,7 +57,7 @@ void tst_run_cmd_fds(void (cleanup_fn)(void),
                        dup2(stderr_fd, STDERR_FILENO);
                }
 
-               _exit(execvp(argv[0], argv));
+               _exit(execvp(argv[0], (char *const *)argv));
        }
 
        int ret = -1;
@@ -73,7 +73,7 @@ void tst_run_cmd_fds(void (cleanup_fn)(void),
 }
 
 void tst_run_cmd(void (cleanup_fn)(void),
-               char *const argv[],
+               const char *const argv[],
                const char *stdout_path,
                const char *stderr_path)
 {
-- 
1.7.1


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to