Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Sep 2012 21:27:37 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r240935 - projects/mtree/contrib/install
Message-ID:  <201209252127.q8PLRbYR098512@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209252127.q8PLRbYR098512>