From owner-svn-src-projects@FreeBSD.ORG Tue Sep 25 21:27:37 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8557106566B; Tue, 25 Sep 2012 21:27:37 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA0958FC08; Tue, 25 Sep 2012 21:27:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8PLRb14098514; Tue, 25 Sep 2012 21:27:37 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8PLRbYR098512; Tue, 25 Sep 2012 21:27:37 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201209252127.q8PLRbYR098512@svn.freebsd.org> From: Brooks Davis Date: Tue, 25 Sep 2012 21:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240935 - projects/mtree/contrib/install X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2012 21:27:38 -0000 Author: brooks Date: Tue Sep 25 21:27:37 2012 New Revision: 240935 URL: http://svn.freebsd.org/changeset/base/240935 Log: s/__dead/__dead2/ Add a NO_SHA384 option. Modified: projects/mtree/contrib/install/xinstall.c Modified: projects/mtree/contrib/install/xinstall.c ============================================================================== --- projects/mtree/contrib/install/xinstall.c Tue Sep 25 21:26:44 2012 (r240934) +++ projects/mtree/contrib/install/xinstall.c Tue Sep 25 21:27:37 2012 (r240935) @@ -105,7 +105,9 @@ enum { DIGEST_RMD160, DIGEST_SHA1, DIGEST_SHA256, +#ifndef NO_SHA384 DIGEST_SHA384, +#endif DIGEST_SHA512, } digesttype = DIGEST_NONE; @@ -134,7 +136,7 @@ static void metadata_log(const char *, c const char *, const char *, off_t); static int parseid(char *, id_t *); static void strip(char *); -__dead static void usage(void); +__dead2 static void usage(void); static char *xbasename(char *); static char *xdirname(char *); @@ -301,8 +303,10 @@ main(int argc, char *argv[]) digesttype = DIGEST_SHA1; } else if (strcmp(digest, "sha256") == 0) { digesttype = DIGEST_SHA256; +#ifndef NO_SHA384 } else if (strcmp(digest, "sha384") == 0) { digesttype = DIGEST_SHA384; +#endif } else if (strcmp(digest, "sha512") == 0) { digesttype = DIGEST_SHA512; } else { @@ -529,9 +533,11 @@ makelink(char *from_name, char *to_name) case DIGEST_SHA256: dres = SHA256_File(from_name, NULL); break; +#ifndef NO_SHA384 case DIGEST_SHA384: dres = SHA384_File(from_name, NULL); break; +#endif case DIGEST_SHA512: dres = SHA512_File(from_name, NULL); break; @@ -819,7 +825,9 @@ copy(int from_fd, char *from_name, int t RMD160_CTX ctxRMD160; SHA1_CTX ctxSHA1; SHA256_CTX ctxSHA256; +#ifndef NO_SHA384 SHA384_CTX ctxSHA384; +#endif SHA512_CTX ctxSHA512; switch (digesttype) { @@ -835,9 +843,11 @@ copy(int from_fd, char *from_name, int t case DIGEST_SHA256: SHA256_Init(&ctxSHA256); break; +#ifndef NO_SHA384 case DIGEST_SHA384: SHA384_Init(&ctxSHA384); break; +#endif case DIGEST_SHA512: SHA512_Init(&ctxSHA512); break; @@ -890,9 +900,11 @@ copy(int from_fd, char *from_name, int t case DIGEST_SHA256: SHA256_Update(&ctxSHA256, p, size); break; +#ifndef NO_SHA384 case DIGEST_SHA384: SHA384_Update(&ctxSHA384, p, size); break; +#endif case DIGEST_SHA512: SHA512_Update(&ctxSHA512, p, size); break; @@ -923,9 +935,11 @@ copy(int from_fd, char *from_name, int t case DIGEST_SHA256: SHA256_Update(&ctxSHA256, buf, nr); break; +#ifndef NO_SHA384 case DIGEST_SHA384: SHA384_Update(&ctxSHA384, buf, nr); break; +#endif case DIGEST_SHA512: SHA512_Update(&ctxSHA512, buf, nr); break; @@ -949,8 +963,10 @@ copy(int from_fd, char *from_name, int t return SHA1End(&ctxSHA1, NULL); case DIGEST_SHA256: return SHA256_End(&ctxSHA256, NULL); +#ifndef NO_SHA384 case DIGEST_SHA384: return SHA384_End(&ctxSHA384, NULL); +#endif case DIGEST_SHA512: return SHA512_End(&ctxSHA512, NULL); default: