+ sprintf_alloc(&list_file_name, "%s/%s.list.XXXXXX",
+ conf->tmp_dir, pkg->name);
+ fd = mkstemp(list_file_name);
+ if (fd == -1) {
+ opkg_message(conf, OPKG_ERROR, "%s: mkstemp(%s): %s",
+ __FUNCTION__, list_file_name, strerror(errno));
+ free(list_file_name);
+ return pkg->installed_files;
+ }
+ list_file = fdopen(fd, "rw");
+ if (list_file == NULL) {
+ opkg_message(conf, OPKG_ERROR, "%s: fdopen: %s",
+ __FUNCTION__, strerror(errno));
+ close(fd);
+ unlink(list_file_name);
+ free(list_file_name);
+ return pkg->installed_files;
+ }