From: pixdamix Date: Wed, 18 Nov 2009 16:02:23 +0000 (+0000) Subject: Fix a bug introduced in r323. X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b8b7c2f67ef418e061e896ab8caf07c7d8f5e50a;p=oweals%2Fopkg-lede.git 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);