summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-06-17 14:40:50 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-06-17 14:40:50 +0300
commit557d360c7f1f7f48fa13fd5dbe0182b63d9e7eca (patch)
treec8689e56e850e06a2f9c2231054ff16dab9ea4c5 /src
parent9d100378074d21f99dc26bae8417932dc110664e (diff)
downloadapk-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')
-rw-r--r--src/apk_io.h1
-rw-r--r--src/url.c33
2 files changed, 0 insertions, 34 deletions
diff --git a/src/apk_io.h b/src/apk_io.h
index 2a6db5a..c79a9f5 100644
--- a/src/apk_io.h
+++ b/src/apk_io.h
@@ -129,7 +129,6 @@ typedef int apk_dir_file_cb(void *ctx, int dirfd, const char *entry);
int apk_dir_foreach_file(int dirfd, apk_dir_file_cb cb, void *ctx);
int apk_move_file(int atfd, const char *from, const char *to);
-int apk_url_download(const char *url, int atfd, const char *file);
const char *apk_url_local_file(const char *url);
void apk_id_cache_init(struct apk_id_cache *idc, int root_fd);
diff --git a/src/url.c b/src/url.c
index c96e0a1..8012bab 100644
--- a/src/url.c
+++ b/src/url.c
@@ -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;
-}
-