diff options
author | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-12-20 19:13:22 (EST) |
---|---|---|
committer | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-12-20 19:13:22 (EST) |
commit | 599cc259280ccde97b2a3b459c3f015db6390127 (patch) | |
tree | 6447c3ee9a08d4de07f875145ba7b10d8bb103ff /libopkg/pkg.c | |
parent | 46b5b8779dbb8e5e03622fc34dbc943a4400c436 (diff) |
Initial stab at untangling the #include maze. Probably needs a second pass.
git-svn-id: http://opkg.googlecode.com/svn/trunk@504 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/pkg.c')
-rw-r--r-- | libopkg/pkg.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libopkg/pkg.c b/libopkg/pkg.c index e541825..bd7e9f8 100644 --- a/libopkg/pkg.c +++ b/libopkg/pkg.c @@ -15,12 +15,12 @@ General Public License for more details. */ -#include "includes.h" -#include <ctype.h> -#include <alloca.h> +#include "config.h" + +#include <stdio.h> #include <string.h> -#include <stdbool.h> -#include <errno.h> +#include <ctype.h> +#include <unistd.h> #include "pkg.h" @@ -274,15 +274,17 @@ pkg_init_from_file(pkg_t *pkg, const char *filename) { int fd, err = 0; FILE *control_file; - char *control_path; + char *control_path, *tmp; pkg_init(pkg); pkg->local_filename = xstrdup(filename); + tmp = xstrdup(filename); sprintf_alloc(&control_path, "%s/%s.control.XXXXXX", conf->tmp_dir, - basename(filename)); + basename(tmp)); + free(tmp); fd = mkstemp(control_path); if (fd == -1) { opkg_perror(ERROR, "Failed to make temp file %s", control_path); |