[libvirt] [PATCH 2/8] util: file: Remove virFileReadLink

Peter Krempa pkrempa at redhat.com
Wed Nov 13 13:07:03 UTC 2019


The function is unused so we can remove it.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/libvirt_private.syms |  1 -
 src/util/virfile.c       | 13 -------------
 src/util/virfile.h       |  3 ---
 3 files changed, 17 deletions(-)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 4d0d03c580..c706553e37 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1978,7 +1978,6 @@ virFileReadBufQuiet;
 virFileReadHeaderFD;
 virFileReadHeaderQuiet;
 virFileReadLimFD;
-virFileReadLink;
 virFileReadValueBitmap;
 virFileReadValueInt;
 virFileReadValueScaledInt;
diff --git a/src/util/virfile.c b/src/util/virfile.c
index ced0ea70b7..b1aeaa5851 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -81,7 +81,6 @@
 #include "virutil.h"

 #include "c-ctype.h"
-#include "areadlink.h"

 #define VIR_FROM_THIS VIR_FROM_NONE

@@ -1625,18 +1624,6 @@ virFileIsLink(const char *linkpath)
     return S_ISLNK(st.st_mode) != 0;
 }

-/*
- * Read where symlink is pointing to.
- *
- * Returns 0 on success (@linkpath is a successfully read link),
- *        -1 with errno set upon error.
- */
-int
-virFileReadLink(const char *linkpath, char **resultpath)
-{
-    return (*resultpath = areadlink(linkpath)) ? 0 : -1;
-}
-
 /*
  * Finds a requested executable file in the PATH env. e.g.:
  * "qemu-img" will return "/usr/bin/qemu-img"
diff --git a/src/util/virfile.h b/src/util/virfile.h
index a570529330..9a8709b52c 100644
--- a/src/util/virfile.h
+++ b/src/util/virfile.h
@@ -176,9 +176,6 @@ int virFileResolveAllLinks(const char *linkpath,
 int virFileIsLink(const char *linkpath)
     ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT;

-int virFileReadLink(const char *linkpath, char **resultpath)
-    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
-
 char *virFindFileInPath(const char *file);

 char *virFileFindResource(const char *filename,
-- 
2.23.0




More information about the libvir-list mailing list