@@ -146,14 +146,17 @@ repo_match_cb(struct xbps_handle *xhp,
146146
147147 r = xbps_pkg_path_or_url (xhp , bfile , sizeof (bfile ), obj );
148148 if (r < 0 ) {
149- xbps_error_printf ( "could not get package path: %s\n" , strerror ( - r ));
150- return - r ;
149+ return xbps_error_errno (
150+ r , "could not get package path: %s\n" , strerror ( - r )) ;
151151 }
152+ errno = 0 ;
152153 filesd = xbps_archive_fetch_plist (bfile , "/files.plist" );
153154 if (!filesd ) {
154- xbps_error_printf ("%s: couldn't fetch files.plist from %s: %s\n" ,
155- pkgver , bfile , strerror (errno ));
156- return EINVAL ;
155+ if (errno == 0 )
156+ errno = EINVAL ;
157+ return xbps_error_errno (errno ,
158+ "%s: couldn't fetch files.plist from %s: %s\n" , pkgver ,
159+ bfile , strerror (errno ));
157160 }
158161 files_keys = xbps_dictionary_all_keys (filesd );
159162 for (unsigned int i = 0 ; i < xbps_array_count (files_keys ); i ++ ) {
@@ -175,7 +178,7 @@ repo_ownedby_cb(struct xbps_repo *repo, void *arg, bool *done UNUSED)
175178
176179 ffd -> repouri = repo -> uri ;
177180 allkeys = xbps_dictionary_all_keys (repo -> idx );
178- rv = xbps_array_foreach_cb_multi (repo -> xhp , allkeys , repo -> idx , repo_match_cb , ffd );
181+ rv = - xbps_array_foreach_cb_multi (repo -> xhp , allkeys , repo -> idx , repo_match_cb , ffd );
179182 xbps_object_release (allkeys );
180183
181184 return rv ;
0 commit comments