lib/repo-finder-mount: Fix propagating NULL errors
authorPhilip Withnall <withnall@endlessm.com>
Tue, 24 Oct 2017 14:26:49 +0000 (15:26 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 24 Oct 2017 16:59:54 +0000 (16:59 +0000)
These two code paths tried to propagate errors which had never been set.
Set new errors instead.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1303
Approved by: cgwalters

src/libostree/ostree-repo-finder-mount.c

index b41c2c8c4afecbd1ea8e6507e953d1db4ca34990..bae3664e7daa9e720a2dedb3fbf6909f351f687d 100644 (file)
@@ -235,8 +235,7 @@ scan_repo (int                 dfd,
     {
       g_debug ("Ignoring repository ‘%s’ on mount ‘%s’ as it’s on a different file system from the mount",
                path, mount_name);
-      g_propagate_error (error, g_steal_pointer (&local_error));
-      return FALSE;
+      return glnx_throw (error, "Repository is on a different file system from the mount");
     }
 
   /* Exclude repositories which resolve to @parent_repo. */
@@ -245,8 +244,7 @@ scan_repo (int                 dfd,
     {
       g_debug ("Ignoring repository ‘%s’ on mount ‘%s’ as it is the same as the one we are resolving",
                path, mount_name);
-      g_propagate_error (error, g_steal_pointer (&local_error));
-      return FALSE;
+      return glnx_throw (error, "Repository is the same as the one we are resolving");
     }
 
   /* List the repo’s refs and return them. */