mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
tools perf util: Make rm_rf(path) argument const
rm_rf() doesn't modify its path argument, and a future caller will pass a string constant into it to delete. Signed-off-by: Joe Stringer <joe@ovn.org> Cc: Alexei Starovoitov <ast@fb.com> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Wang Nan <wangnan0@huawei.com> Cc: netdev@vger.kernel.org Link: http://lkml.kernel.org/r/20170126212001.14103-5-joe@ovn.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
d5148d8554
commit
9a9c733d68
2 changed files with 2 additions and 2 deletions
|
@ -85,7 +85,7 @@ int mkdir_p(char *path, mode_t mode)
|
||||||
return (stat(path, &st) && mkdir(path, mode)) ? -1 : 0;
|
return (stat(path, &st) && mkdir(path, mode)) ? -1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rm_rf(char *path)
|
int rm_rf(const char *path)
|
||||||
{
|
{
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
|
@ -209,7 +209,7 @@ static inline int sane_case(int x, int high)
|
||||||
}
|
}
|
||||||
|
|
||||||
int mkdir_p(char *path, mode_t mode);
|
int mkdir_p(char *path, mode_t mode);
|
||||||
int rm_rf(char *path);
|
int rm_rf(const char *path);
|
||||||
struct strlist *lsdir(const char *name, bool (*filter)(const char *, struct dirent *));
|
struct strlist *lsdir(const char *name, bool (*filter)(const char *, struct dirent *));
|
||||||
bool lsdir_no_dot_filter(const char *name, struct dirent *d);
|
bool lsdir_no_dot_filter(const char *name, struct dirent *d);
|
||||||
int copyfile(const char *from, const char *to);
|
int copyfile(const char *from, const char *to);
|
||||||
|
|
Loading…
Reference in a new issue