Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Remove dead code
Baptiste Daroussin committed 13 years ago
commit 145f74a4a88f50dc133839e7738cf56355766044
parent 95e6d04
2 files changed +0 -47
modified libpkg/private/utils.h
@@ -89,7 +89,6 @@ struct dns_srvinfo *
	dns_getsrvinfo(const char *zone);

int set_nameserver(const char *nsname);
-
int pkg_popen(const char *cmd, FILE **in, FILE **out, pid_t *pid);


#endif
modified libpkg/utils.c
@@ -405,49 +405,3 @@ is_hardlink(struct hardlinks *hl, struct stat *st)

	return (true);
}
-

-
int
-
pkg_popen(const char *cmd, FILE **in, FILE **out, pid_t *pid)
-
{
-
	int pin[2], pout[2];
-
	*in = NULL;
-
	*out = NULL;
-

-
	if (pipe(pin) < 0)
-
		return (EPKG_FATAL);
-
	if (pipe(pout) < 0) {
-
		close(pin[0]);
-
		close(pin[1]);
-
		return (EPKG_FATAL);
-
	}
-
	if ((*pid = vfork()) <0) {
-
		close(pin[0]);
-
		close(pin[1]);
-
		close(pout[0]);
-
		close(pout[1]);
-
		return (EPKG_FATAL);
-
	}
-

-
	if (*pid == 0) {
-
		close(0);
-
		dup(pout[0]);
-

-
		close(pout[0]);
-
		close(pout[1]);
-

-
		close(1);
-
		dup(pin[1]);
-

-
		close(pin[0]);
-
		close(pin[1]);
-

-
		execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)0);
-
		return (EPKG_FATAL);
-
	} else {
-
		close(pin[1]);
-
		*in = fdopen(pin[0], "r");
-
		close(pout[0]);
-
		*out = fdopen(pout[1], "w");
-
		return (EPKG_OK);
-
	}
-
}