diff options
author | Timo Teräs <timo.teras@iki.fi> | 2013-06-17 14:40:50 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2013-06-17 14:40:50 +0300 |
commit | 557d360c7f1f7f48fa13fd5dbe0182b63d9e7eca (patch) | |
tree | c8689e56e850e06a2f9c2231054ff16dab9ea4c5 /src/url.c | |
parent | 9d100378074d21f99dc26bae8417932dc110664e (diff) | |
download | apk-tools-557d360c7f1f7f48fa13fd5dbe0182b63d9e7eca.tar.gz apk-tools-557d360c7f1f7f48fa13fd5dbe0182b63d9e7eca.tar.bz2 apk-tools-557d360c7f1f7f48fa13fd5dbe0182b63d9e7eca.tar.xz apk-tools-557d360c7f1f7f48fa13fd5dbe0182b63d9e7eca.zip |
url: remove unused apk_url_download
Diffstat (limited to 'src/url.c')
-rw-r--r-- | src/url.c | 33 |
1 files changed, 0 insertions, 33 deletions
@@ -114,36 +114,3 @@ struct apk_bstream *apk_bstream_from_fd_url(int atfd, const char *url) fd = fork_wget(url, &pid); return apk_bstream_from_fd_pid(fd, pid, translate_wget); } - -int apk_url_download(const char *url, int atfd, const char *file) -{ - pid_t pid; - int status, fd; - - fd = openat(atfd, file, O_CREAT|O_RDWR|O_TRUNC, 0644); - if (fd < 0) - return -errno; - - pid = fork(); - if (pid == -1) - return -1; - - if (pid == 0) { - setsid(); - dup2(open("/dev/null", O_RDONLY), STDIN_FILENO); - dup2(fd, STDOUT_FILENO); - execlp("wget", "wget", "-q", "-O", "-", url, NULL); - exit(0); - } - - close(fd); - waitpid(pid, &status, 0); - status = translate_wget(status); - if (status != 0) { - unlinkat(atfd, file, 0); - return status; - } - - return 0; -} - |