From b8b7c2f67ef418e061e896ab8caf07c7d8f5e50a Mon Sep 17 00:00:00 2001 From: pixdamix Date: Wed, 18 Nov 2009 11:02:23 -0500 Subject: 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 --- 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); -- cgit v0.9.1