Don't try to close the file if its not open.
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Tue, 12 Jan 2010 04:52:37 +0000 (04:52 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Tue, 12 Jan 2010 04:52:37 +0000 (04:52 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@517 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/opkg_conf.c

index bcc79ed16d8d45e2ab7dfb07256dd4646606e161..678f2197f89ab6dea6541b685fa0986e328bf3a9 100644 (file)
@@ -376,7 +376,7 @@ opkg_conf_write_status_files(void)
 
      list_for_each_entry(iter, &conf->pkg_dest_list.head, node) {
           dest = (pkg_dest_t *)iter->data;
-          if (fclose(dest->status_fp) == EOF) {
+          if (dest->status_fp && fclose(dest->status_fp) == EOF) {
                opkg_perror(ERROR, "Couldn't close %s", dest->status_file_name);
               ret = -1;
           }