git: 117844539758 - stable/12 - objcopy: fix stable/12 mismerge

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Mon, 08 Nov 2021 19:33:30 UTC
The branch stable/12 has been updated by emaste:

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

commit 11784453975887ef84f7843248bec90dda701eef
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2021-11-08 19:30:29 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2021-11-08 19:32:59 +0000

    objcopy: fix stable/12 mismerge
    
    Reported by:    dim
    Fixes:          2cd53619a1fc ("strip/objcopy: handle empty file...")
    Sponsored by:   The FreeBSD Foundation
---
 contrib/elftoolchain/elfcopy/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/contrib/elftoolchain/elfcopy/main.c b/contrib/elftoolchain/elfcopy/main.c
index ae2d3a2440df..995f031dfa69 100644
--- a/contrib/elftoolchain/elfcopy/main.c
+++ b/contrib/elftoolchain/elfcopy/main.c
@@ -701,11 +701,12 @@ create_file(struct elfcopy *ecp, const char *src, const char *dst)
 		free(elftemp);
 	}
 
-	if ((ecp->ein = elf_begin(ifd, ELF_C_READ, NULL)) == NULL)
+	if ((ecp->ein = elf_begin(ifd, ELF_C_READ, NULL)) == NULL) {
 		if (fstat(ifd, &sb) == 0 && sb.st_size == 0)
 			errx(EXIT_FAILURE, "file format not recognized");
 		errx(EXIT_FAILURE, "elf_begin() failed: %s",
 		    elf_errmsg(-1));
+	}
 
 	switch (elf_kind(ecp->ein)) {
 	case ELF_K_NONE: