]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
userdb: use RET_GATHER() at one more place and update comment
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 4 Jun 2025 09:14:02 +0000 (18:14 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 4 Jun 2025 12:50:12 +0000 (21:50 +0900)
src/shared/userdb.c

index 5274f87da17b03f71e02b2db5a02111ad72bc850..a5c72cfa5dafb1d74b975d1988f4d57d1dfe56da 100644 (file)
@@ -605,12 +605,11 @@ static int userdb_start_query(
                 if (is_dropin && r >= 0)
                         iterator->dropin_covered = true;
 
-                if (ret == 0 && r < 0)
-                        ret = r;
+                RET_GATHER(ret, r);
         }
 
         if (set_isempty(iterator->links))
-                return ret < 0 ? ret : -ESRCH; /* propagate last error we saw if we couldn't connect to anything. */
+                return ret < 0 ? ret : -ESRCH; /* propagate the first error we saw if we couldn't connect to anything. */
 
         /* We connected to some services, in this case, ignore the ones we failed on */
         return 0;