@@ -18,7 +18,7 @@ bool *tracefs_dir_exists*(struct tracefs_instance pass:[*]_instance_, char pass:
char pass:[*]*tracefs_instance_get_file*(struct tracefs_instance pass:[*]_instance_, const char pass:[*]_file_);
char pass:[*]*tracefs_instance_get_dir*(struct tracefs_instance pass:[*]_instance_);
int *tracefs_instance_file_write*(struct tracefs_instance pass:[*]_instance_, const char pass:[*]_file_, const char pass:[*]_str_);
-char pass:[*]*tracefs_instance_file_read*(struct tracefs_instance pass:[*]_instance_, char pass:[*]_file_, int pass:[*]_psize_);
+char pass:[*]*tracefs_instance_file_read*(struct tracefs_instance pass:[*]_instance_, const char pass:[*]_file_, int pass:[*]_psize_);
--
@@ -26,7 +26,7 @@ Trace instances:
char pass:[*]*tracefs_instance_get_file*(struct tracefs_instance pass:[*]_instance_, const char pass:[*]_file_);
char pass:[*]*tracefs_instance_get_dir*(struct tracefs_instance pass:[*]_instance_);
int *tracefs_instance_file_write*(struct tracefs_instance pass:[*]_instance_, const char pass:[*]_file_, const char pass:[*]_str_);
- char pass:[*]*tracefs_instance_file_read*(struct tracefs_instance pass:[*]_instance_, char pass:[*]_file_, int pass:[*]_psize_);
+ char pass:[*]*tracefs_instance_file_read*(struct tracefs_instance pass:[*]_instance_, const char pass:[*]_file_, int pass:[*]_psize_);
const char pass:[*]*tracefs_instance_get_name*(struct tracefs_instance pass:[*]_instance_);
int *tracefs_instances_walk*(int (pass:[*]_callback_)(const char pass:[*], void pass:[*]), void pass:[*]_context)_;
bool *tracefs_instance_exists*(const char pass:[*]_name_);
@@ -29,7 +29,7 @@ char *tracefs_instance_get_dir(struct tracefs_instance *instance);
int tracefs_instance_file_write(struct tracefs_instance *instance,
const char *file, const char *str);
char *tracefs_instance_file_read(struct tracefs_instance *instance,
- char *file, int *psize);
+ const char *file, int *psize);
int tracefs_instances_walk(int (*callback)(const char *, void *), void *context);
bool tracefs_instance_exists(const char *name);
@@ -282,7 +282,7 @@ int tracefs_instance_file_write(struct tracefs_instance *instance,
* The return string must be freed by free()
*/
char *tracefs_instance_file_read(struct tracefs_instance *instance,
- char *file, int *psize)
+ const char *file, int *psize)
{
char *buf = NULL;
int size = 0;
@@ -181,7 +181,7 @@ static void test_trace_file(void)
tracefs_put_tracing_file(file);
}
-static void test_instance_file_read(struct tracefs_instance *inst, char *fname)
+static void test_instance_file_read(struct tracefs_instance *inst, const char *fname)
{
const char *tdir = tracefs_tracing_dir();
char buf[BUFSIZ];
The file name input parameter of tracefs_instance_file_read() API should be a pointer to a constat string, as this file name must not be changed by the API. Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> --- Documentation/libtracefs-instances-files.txt | 2 +- Documentation/libtracefs.txt | 2 +- include/tracefs.h | 2 +- src/tracefs-instance.c | 2 +- utest/tracefs-utest.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)