xbps-fbulk: do not make assert() change program behaviour.

... otherwise if NDEBUG is set chdir() is skipped completely.
This commit is contained in:
Juan RP 2019-07-06 08:37:47 +02:00
parent 702d64c517
commit d927517327
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368

View File

@ -656,7 +656,10 @@ main(int argc, char **argv)
* Process all directories in void-packages/srcpkgs, excluding symlinks * Process all directories in void-packages/srcpkgs, excluding symlinks
* (subpackages). * (subpackages).
*/ */
assert(chdir(rpath) == 0); if (chdir(rpath) == -1) {
fprintf(stderr, "ERROR: failed to chdir to %s: %s\n", rpath, strerror(errno));
exit(EXIT_FAILURE);
}
if ((dir = opendir(rpath)) != NULL) { if ((dir = opendir(rpath)) != NULL) {
while ((den = readdir(dir)) != NULL) { while ((den = readdir(dir)) != NULL) {