Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Remove dead code
Baptiste Daroussin committed 11 years ago
commit 573f777a2fc22bba502c276a42416d0652c86f69
parent 01d6814
2 files changed +0 -40
modified src/pkgcli.h
@@ -260,7 +260,6 @@ bool query_tty_yesno(bool deft, const char *msg, ...);
int info_flags(uint64_t opt, bool remote);
void print_info(struct pkg * const pkg, uint64_t opt);
int print_jobs_summary(struct pkg_jobs *j, const char *msg, ...);
-
int hash_file(const char *, char[SHA256_DIGEST_LENGTH * 2 +1]);

void job_status_begin(struct sbuf *);
void job_status_end(struct sbuf *);
modified src/utils.c
@@ -877,45 +877,6 @@ print_jobs_summary(struct pkg_jobs *jobs, const char *msg, ...)
	return (displayed);
}

-
int
-
hash_file(const char *path, char out[SHA256_DIGEST_LENGTH * 2 + 1])
-
{
-
	FILE *fp;
-
	char buffer[BUFSIZ];
-
	unsigned char hash[SHA256_DIGEST_LENGTH];
-
	size_t r = 0;
-
	SHA256_CTX sha256;
-
	int i;
-

-
	if ((fp = fopen(path, "rb")) == NULL) {
-
		warn("fopen(%s)", path);
-
		return (EPKG_FATAL);
-
	}
-

-
	SHA256_Init(&sha256);
-

-
	while ((r = fread(buffer, 1, BUFSIZ, fp)) > 0)
-
		SHA256_Update(&sha256, buffer, r);
-

-
	if (ferror(fp) != 0) {
-
		fclose(fp);
-
		out[0] = '\0';
-
		warn("fread(%s)", path);
-
		return (EPKG_FATAL);
-
	}
-

-
	fclose(fp);
-

-
	SHA256_Final(hash, &sha256);
-

-
	for (i = 0; i < SHA256_DIGEST_LENGTH; i++)
-
		sprintf(out + (i * 2), "%02x", hash[i]);
-

-
	out[SHA256_DIGEST_LENGTH * 2] = '\0';
-

-
	return (EPKG_OK);
-
}
-

void
sbuf_flush(struct sbuf *buf)
{