diff options
author | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-11-22 18:15:05 (EST) |
---|---|---|
committer | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-11-22 18:15:05 (EST) |
commit | 010f770102220799a83245db81110df0d7940aad (patch) | |
tree | 1a209e28b397253b905b8499f1854acddb335ce8 | |
parent | 7210f5571f7d93e2e62c80353a2923ee7e64968b (diff) |
Change fdopen(fd, "rw+") to fdopen(fd, "r+").
It was pointed out by Basinilya in Issue 30 that the manual does not specify
"rw+" (and this causes problems on Solaris). Since mkstemp should have already
created the file, use "r+" for opening the fd in read/write mode.
git-svn-id: http://opkg.googlecode.com/svn/trunk@345 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r-- | libopkg/pkg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopkg/pkg.c b/libopkg/pkg.c index b01db61..75e9572 100644 --- a/libopkg/pkg.c +++ b/libopkg/pkg.c @@ -319,7 +319,7 @@ pkg_init_from_file(pkg_t *pkg, const char *filename) goto err0; } - control_file = fdopen(fd, "rw+"); + control_file = fdopen(fd, "r+"); if (control_file == NULL) { perror_msg("%s: fdopen", __FUNCTION__, control_path); close(fd); @@ -1044,7 +1044,7 @@ str_list_t *pkg_get_installed_files(opkg_conf_t *conf, pkg_t *pkg) free(list_file_name); return pkg->installed_files; } - list_file = fdopen(fd, "rw+"); + list_file = fdopen(fd, "r+"); if (list_file == NULL) { opkg_message(conf, OPKG_ERROR, "%s: fdopen: %s", __FUNCTION__, strerror(errno)); |