summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpixdamix <pixdamix@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-18 11:02:23 (EST)
committer pixdamix <pixdamix@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-18 11:02:23 (EST)
commitb8b7c2f67ef418e061e896ab8caf07c7d8f5e50a (patch)
treef0b5bbed184b44cd00af2837a0b449dac6194919
parent91196cf7d2b3f1694ac02cc682bb60bf78d6538d (diff)
Fix a bug introduced in r323.
fdopen(fd, "rw") can cause a bad file descriptor error. git-svn-id: http://opkg.googlecode.com/svn/trunk@333 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--libopkg/pkg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopkg/pkg.c b/libopkg/pkg.c
index 5d705c7..f73cf5c 100644
--- a/libopkg/pkg.c
+++ b/libopkg/pkg.c
@@ -334,7 +334,7 @@ pkg_init_from_file(pkg_t *pkg, const char *filename)
goto err0;
}
- control_file = fdopen(fd, "rw");
+ control_file = fdopen(fd, "rw+");
if (control_file == NULL) {
perror_msg("%s: fdopen", __FUNCTION__, control_path);
close(fd);