Fixes Issue #54.
git-svn-id: http://opkg.googlecode.com/svn/trunk@542
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
if (lockf(lock_fd, F_TLOCK, (off_t)0) == -1) {
opkg_perror(ERROR, "Could not lock %s", lock_file);
if (lockf(lock_fd, F_TLOCK, (off_t)0) == -1) {
opkg_perror(ERROR, "Could not lock %s", lock_file);
+ if (close(lock_fd) == -1)
+ opkg_perror(ERROR, "Couldn't close descriptor %d (%s)",
+ lock_fd, lock_file);
+ goto err2;
conf->tmp_dir = mkdtemp(tmp);
if (conf->tmp_dir == NULL) {
opkg_perror(ERROR, "Creating temp dir %s failed", tmp);
conf->tmp_dir = mkdtemp(tmp);
if (conf->tmp_dir == NULL) {
opkg_perror(ERROR, "Creating temp dir %s failed", tmp);
}
if (resolve_pkg_dest_list(&tmp_dest_nv_pair_list))
}
if (resolve_pkg_dest_list(&tmp_dest_nv_pair_list))
nv_pair_list_deinit(&tmp_dest_nv_pair_list);
return 0;
nv_pair_list_deinit(&tmp_dest_nv_pair_list);
return 0;
free(conf->lists_dir);
pkg_hash_deinit();
free(conf->lists_dir);
pkg_hash_deinit();
if (rmdir(conf->tmp_dir) == -1)
opkg_perror(ERROR, "Couldn't remove dir %s", conf->tmp_dir);
if (rmdir(conf->tmp_dir) == -1)
opkg_perror(ERROR, "Couldn't remove dir %s", conf->tmp_dir);
if (lockf(lock_fd, F_ULOCK, (off_t)0) == -1)
opkg_perror(ERROR, "Couldn't unlock %s", lock_file);
if (lockf(lock_fd, F_ULOCK, (off_t)0) == -1)
opkg_perror(ERROR, "Couldn't unlock %s", lock_file);
if (close(lock_fd) == -1)
opkg_perror(ERROR, "Couldn't close descriptor %d (%s)",
lock_fd, lock_file);
if (close(lock_fd) == -1)
opkg_perror(ERROR, "Couldn't close descriptor %d (%s)",
lock_fd, lock_file);