From b8b7c2f67ef418e061e896ab8caf07c7d8f5e50a Mon Sep 17 00:00:00 2001 From: pixdamix Date: Wed, 18 Nov 2009 16:02:23 +0000 Subject: [PATCH] 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 --- libopkg/pkg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.25.1