From owner-svn-src-head@freebsd.org Mon Dec 23 20:23:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E6431CFAB5; Mon, 23 Dec 2019 20:23:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47hW4m0s65z41vW; Mon, 23 Dec 2019 20:23:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 189D81D226; Mon, 23 Dec 2019 20:23:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBNKN3Mm026129; Mon, 23 Dec 2019 20:23:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBNKN33Y026124; Mon, 23 Dec 2019 20:23:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912232023.xBNKN33Y026124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 23 Dec 2019 20:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356041 - head/usr.sbin/fstyp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/fstyp X-SVN-Commit-Revision: 356041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2019 20:23:04 -0000 Author: cem Date: Mon Dec 23 20:23:02 2019 New Revision: 356041 URL: https://svnweb.freebsd.org/changeset/base/356041 Log: fstyp(8): Fix WITHOUT_ICONV build Reported by: olivier Modified: head/usr.sbin/fstyp/Makefile head/usr.sbin/fstyp/apfs.c head/usr.sbin/fstyp/exfat.c head/usr.sbin/fstyp/fstyp.c head/usr.sbin/fstyp/hfsplus.c head/usr.sbin/fstyp/ntfs.c Modified: head/usr.sbin/fstyp/Makefile ============================================================================== --- head/usr.sbin/fstyp/Makefile Mon Dec 23 20:19:23 2019 (r356040) +++ head/usr.sbin/fstyp/Makefile Mon Dec 23 20:23:02 2019 (r356041) @@ -13,6 +13,10 @@ MAN= fstyp.8 WARNS?= 2 +.if ${MK_ICONV} == "yes" +CFLAGS+= -DWITH_ICONV +.endif + .include .if ${TARGET_ENDIANNESS} == 1234 Modified: head/usr.sbin/fstyp/apfs.c ============================================================================== --- head/usr.sbin/fstyp/apfs.c Mon Dec 23 20:19:23 2019 (r356040) +++ head/usr.sbin/fstyp/apfs.c Mon Dec 23 20:23:02 2019 (r356041) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/usr.sbin/fstyp/exfat.c ============================================================================== --- head/usr.sbin/fstyp/exfat.c Mon Dec 23 20:19:23 2019 (r356040) +++ head/usr.sbin/fstyp/exfat.c Mon Dec 23 20:23:02 2019 (r356041) @@ -33,7 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef WITH_ICONV #include +#endif #include #include #include @@ -184,6 +186,7 @@ exfat_compute_boot_chksum(FILE *fp, unsigned region, u return (0); } +#ifdef WITH_ICONV static void convert_label(const uint16_t *ucs2label /* LE */, unsigned ucs2len, char *label_out, size_t label_sz) @@ -316,6 +319,7 @@ exfat_find_label(FILE *fp, const struct exfat_vbr *ev, free(declust); } } +#endif /* WITH_ICONV */ int fstyp_exfat(FILE *fp, char *label, size_t size) @@ -356,8 +360,10 @@ fstyp_exfat(FILE *fp, char *label, size_t size) goto done; } +#ifdef WITH_ICONV if (show_label) exfat_find_label(fp, ev, bytespersec, label, size); +#endif done: free(cksect); Modified: head/usr.sbin/fstyp/fstyp.c ============================================================================== --- head/usr.sbin/fstyp/fstyp.c Mon Dec 23 20:19:23 2019 (r356040) +++ head/usr.sbin/fstyp/fstyp.c Mon Dec 23 20:23:02 2019 (r356041) @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef WITH_ICONV #include +#endif #include #include #include @@ -199,6 +201,7 @@ main(int argc, char **argv) err(1, "setlocale"); caph_cache_catpages(); +#ifdef WITH_ICONV /* Cache iconv conversion data before entering capability mode. */ if (show_label) { for (i = 0; i < nitems(fstypes); i++) { @@ -214,6 +217,7 @@ main(int argc, char **argv) iconv_close(cd); } } +#endif fp = fopen(path, "r"); if (fp == NULL) Modified: head/usr.sbin/fstyp/hfsplus.c ============================================================================== --- head/usr.sbin/fstyp/hfsplus.c Mon Dec 23 20:19:23 2019 (r356040) +++ head/usr.sbin/fstyp/hfsplus.c Mon Dec 23 20:23:02 2019 (r356041) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/usr.sbin/fstyp/ntfs.c ============================================================================== --- head/usr.sbin/fstyp/ntfs.c Mon Dec 23 20:19:23 2019 (r356040) +++ head/usr.sbin/fstyp/ntfs.c Mon Dec 23 20:23:02 2019 (r356041) @@ -32,7 +32,9 @@ __FBSDID("$FreeBSD$"); #include +#ifdef WITH_ICONV #include +#endif #include #include #include @@ -94,6 +96,7 @@ struct ntfs_bootfile { uint32_t bf_volsn; } __packed; +#ifdef WITH_ICONV static void convert_label(const void *label /* LE */, size_t labellen, char *label_out, size_t label_sz) @@ -125,6 +128,7 @@ convert_label(const void *label /* LE */, size_t label iconv_close(cd); } +#endif int fstyp_ntfs(FILE *fp, char *label, size_t size) @@ -142,6 +146,7 @@ fstyp_ntfs(FILE *fp, char *label, size_t size) bf = (struct ntfs_bootfile *)read_buf(fp, 0, 512); if (bf == NULL || strncmp(bf->bf_sysid, "NTFS ", 8) != 0) goto fail; +#ifdef WITH_ICONV if (!show_label) goto ok; @@ -171,6 +176,7 @@ fstyp_ntfs(FILE *fp, char *label, size_t size) } ok: +#endif /* WITH_ICONV */ free(bf); free(filerecp);