mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-31 22:17:17 +00:00
tests: Stop mocking canonicalize_file_name()
We're using virFileCanonicalizePath() everywhere now, so mocking this function has become entirely pointless. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
4267393198
commit
3bfe72e3dd
@ -39,7 +39,6 @@ static int (*real_lstat)(const char *path, struct stat *sb);
|
|||||||
static int (*real___lxstat)(int ver, const char *path, struct stat *sb);
|
static int (*real___lxstat)(int ver, const char *path, struct stat *sb);
|
||||||
static int (*real_stat)(const char *path, struct stat *sb);
|
static int (*real_stat)(const char *path, struct stat *sb);
|
||||||
static int (*real___xstat)(int ver, const char *path, struct stat *sb);
|
static int (*real___xstat)(int ver, const char *path, struct stat *sb);
|
||||||
static char *(*real_canonicalize_file_name)(const char *path);
|
|
||||||
static int (*real_open)(const char *path, int flags, ...);
|
static int (*real_open)(const char *path, int flags, ...);
|
||||||
static int (*real_close)(int fd);
|
static int (*real_close)(int fd);
|
||||||
static DIR * (*real_opendir)(const char *name);
|
static DIR * (*real_opendir)(const char *name);
|
||||||
@ -811,7 +810,6 @@ init_syms(void)
|
|||||||
VIR_MOCK_REAL_INIT(access);
|
VIR_MOCK_REAL_INIT(access);
|
||||||
VIR_MOCK_REAL_INIT_ALT(lstat, __lxstat);
|
VIR_MOCK_REAL_INIT_ALT(lstat, __lxstat);
|
||||||
VIR_MOCK_REAL_INIT_ALT(stat, __xstat);
|
VIR_MOCK_REAL_INIT_ALT(stat, __xstat);
|
||||||
VIR_MOCK_REAL_INIT(canonicalize_file_name);
|
|
||||||
VIR_MOCK_REAL_INIT(open);
|
VIR_MOCK_REAL_INIT(open);
|
||||||
VIR_MOCK_REAL_INIT(close);
|
VIR_MOCK_REAL_INIT(close);
|
||||||
VIR_MOCK_REAL_INIT(opendir);
|
VIR_MOCK_REAL_INIT(opendir);
|
||||||
@ -969,25 +967,6 @@ stat(const char *path, struct stat *sb)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
|
||||||
canonicalize_file_name(const char *path)
|
|
||||||
{
|
|
||||||
char *ret;
|
|
||||||
|
|
||||||
init_syms();
|
|
||||||
|
|
||||||
if (STRPREFIX(path, SYSFS_PCI_PREFIX)) {
|
|
||||||
char *newpath;
|
|
||||||
if (getrealpath(&newpath, path) < 0)
|
|
||||||
return NULL;
|
|
||||||
ret = real_canonicalize_file_name(newpath);
|
|
||||||
VIR_FREE(newpath);
|
|
||||||
} else {
|
|
||||||
ret = real_canonicalize_file_name(path);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
open(const char *path, int flags, ...)
|
open(const char *path, int flags, ...)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user