[Libguestfs] [supermin PATCH 2/4] Tighten Unix_error check for missing outputdir

Pino Toscano ptoscano at redhat.com
Fri Apr 3 10:20:56 UTC 2020


When getting the timestamp of the output directory for the --if-newer
checks, ignore ENOENT instead of any Unix_error: the lack of it is OK,
while any other stat error is most likekly an actual problem.
---
 src/supermin.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/supermin.ml b/src/supermin.ml
index 7c7135b3..80c48e6 100644
--- a/src/supermin.ml
+++ b/src/supermin.ml
@@ -245,7 +245,7 @@ appliance automatically.
         exit 0
       )
     with
-      Unix_error _ -> () (* just continue *)
+      Unix_error (ENOENT, _, _) -> () (* just continue *)
   );
 
   (* Create the output directory nearly atomically. *)
-- 
2.25.1




More information about the Libguestfs mailing list