[Libguestfs] [PATCH 1/7] tests: switch last-errno away from deprecated APIs

Pino Toscano ptoscano at redhat.com
Tue Apr 23 16:28:10 UTC 2019


This test only calls stat to check the failure on missing file, so
switch to statns to get the same behaviour with a non-deprecated API.
---
 tests/c-api/test-last-errno.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/c-api/test-last-errno.c b/tests/c-api/test-last-errno.c
index 9c5b2cf3a..056acd526 100644
--- a/tests/c-api/test-last-errno.c
+++ b/tests/c-api/test-last-errno.c
@@ -38,7 +38,7 @@ main (int argc, char *argv[])
 {
   guestfs_h *g;
   int r, err;
-  struct guestfs_stat *stat;
+  struct guestfs_statns *stat;
 
   g = guestfs_create ();
   if (g == NULL)
@@ -79,7 +79,7 @@ main (int argc, char *argv[])
   if (guestfs_mount (g, "/dev/sda1", "/") == -1)
     exit (EXIT_FAILURE);
 
-  stat = guestfs_lstat (g, "/nosuchfile");
+  stat = guestfs_lstatns (g, "/nosuchfile");
   if (stat != NULL)
     error (EXIT_FAILURE, 0,
            "guestfs_lstat: expected error for missing file");
-- 
2.20.1




More information about the Libguestfs mailing list