mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-29 20:11:16 +00:00
util: replace IS_ABSOLUTE_FILE_NAME with g_path_is_absolute
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
12d17dcc26
commit
472cc3941b
@ -77,8 +77,6 @@
|
|||||||
# include <selinux/selinux.h>
|
# include <selinux/selinux.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "dosname.h"
|
|
||||||
|
|
||||||
#define QEMU_QXL_VGAMEM_DEFAULT 16 * 1024
|
#define QEMU_QXL_VGAMEM_DEFAULT 16 * 1024
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_QEMU
|
#define VIR_FROM_THIS VIR_FROM_QEMU
|
||||||
@ -14340,7 +14338,7 @@ qemuDomainCreateDeviceRecursive(const char *device,
|
|||||||
* (want /dev/disk/by-id/../../sda)
|
* (want /dev/disk/by-id/../../sda)
|
||||||
* /dev/stdout -> /proc/self/fd/1 (no change needed)
|
* /dev/stdout -> /proc/self/fd/1 (no change needed)
|
||||||
*/
|
*/
|
||||||
if (IS_RELATIVE_FILE_NAME(target)) {
|
if (!g_path_is_absolute(target)) {
|
||||||
char *c = NULL, *tmp = NULL, *devTmp = NULL;
|
char *c = NULL, *tmp = NULL, *devTmp = NULL;
|
||||||
|
|
||||||
devTmp = g_strdup(device);
|
devTmp = g_strdup(device);
|
||||||
@ -15312,7 +15310,7 @@ qemuDomainAttachDeviceMknodRecursive(virQEMUDriverPtr driver,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_RELATIVE_FILE_NAME(target)) {
|
if (!g_path_is_absolute(target)) {
|
||||||
char *c = NULL, *tmp = NULL, *fileTmp = NULL;
|
char *c = NULL, *tmp = NULL, *fileTmp = NULL;
|
||||||
|
|
||||||
fileTmp = g_strdup(file);
|
fileTmp = g_strdup(file);
|
||||||
|
@ -1562,7 +1562,7 @@ virFileResolveLinkHelper(const char *linkpath,
|
|||||||
/* We don't need the full canonicalization of intermediate
|
/* We don't need the full canonicalization of intermediate
|
||||||
* directories, if linkpath is absolute and the basename is
|
* directories, if linkpath is absolute and the basename is
|
||||||
* already a non-symlink. */
|
* already a non-symlink. */
|
||||||
if (IS_ABSOLUTE_FILE_NAME(linkpath) && !intermediatePaths) {
|
if (g_path_is_absolute(linkpath) && !intermediatePaths) {
|
||||||
if (g_lstat(linkpath, &st) < 0)
|
if (g_lstat(linkpath, &st) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -1640,7 +1640,7 @@ virFindFileInPath(const char *file)
|
|||||||
/* if we are passed an absolute path (starting with /), return a
|
/* if we are passed an absolute path (starting with /), return a
|
||||||
* copy of that path, after validating that it is executable
|
* copy of that path, after validating that it is executable
|
||||||
*/
|
*/
|
||||||
if (IS_ABSOLUTE_FILE_NAME(file)) {
|
if (g_path_is_absolute(file)) {
|
||||||
if (!virFileIsExecutable(file))
|
if (!virFileIsExecutable(file))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user