git: fdf6f6babe61 - stable/12 - /usr/sbin/pkg: don't sleep on fetch failure

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Wed, 12 Oct 2022 09:02:31 UTC
The branch stable/12 has been updated by bapt:

URL: https://cgit.FreeBSD.org/src/commit/?id=fdf6f6babe6169261dd396c9bf966ab8a82a7c64

commit fdf6f6babe6169261dd396c9bf966ab8a82a7c64
Author:     John Hood <jhood@niksun.com>
AuthorDate: 2022-04-21 21:39:14 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2022-10-12 09:01:44 +0000

    /usr/sbin/pkg: don't sleep on fetch failure
    
    PR:     263458
    (cherry picked from commit 60b92ba9323c2dd249ba3a3349b207c2d0b9d212)
---
 usr.sbin/pkg/pkg.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c
index f759a3c31d1f..e5e4c656a51f 100644
--- a/usr.sbin/pkg/pkg.c
+++ b/usr.sbin/pkg/pkg.c
@@ -236,9 +236,7 @@ fetch_to_fd(const char *url, char *path, const char *fetchOpts)
 			--retry;
 			if (retry <= 0)
 				goto fetchfail;
-			if (mirrors == NULL) {
-				sleep(1);
-			} else {
+			if (mirrors != NULL) {
 				current = current->next;
 				if (current == NULL)
 					current = mirrors;