Check return value from close() call.
[libguestfs.git] / daemon / file.c
index 0eef0c0..3f07ffc 100644 (file)
@@ -58,7 +58,11 @@ do_touch (char *path)
     return -1;
   }
 
-  close (fd);
+  if (close (fd) == -1) {
+    reply_with_perror ("close: %s", path);
+    return -1;
+  }
+
   return 0;
 }