summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpixdamix <pixdamix@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-17 06:17:42 (EST)
committer pixdamix <pixdamix@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-17 06:17:42 (EST)
commit98acf192dfcde709aeee5eb8cbaea806e84a6d42 (patch)
tree00611674d7c85f7c1b985939c6b89a08e3bd8629
parent9020bb63c0005f68973b6d21290e7808c63ed487 (diff)
Avoid some warn_unused_result warning
lockf maybe defined with warn_unused_result. Check the return value to disable the warning (And add an error message by the way) git-svn-id: http://opkg.googlecode.com/svn/trunk@330 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--libopkg/opkg_conf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
index cade51a..c69c3d1 100644
--- a/libopkg/opkg_conf.c
+++ b/libopkg/opkg_conf.c
@@ -415,7 +415,12 @@ void opkg_conf_deinit(opkg_conf_t *conf)
if (&conf->obs_file_hash)
hash_table_deinit(&conf->obs_file_hash);
- lockf(conf->lock_fd, F_ULOCK, 0);
+ /* lockf maybe defined with warn_unused_result */
+ if(lockf(conf->lock_fd, F_ULOCK, 0) != 0){
+ opkg_message(conf, OPKG_DEBUG, "%s: unlock failed: %s\n",
+ __FUNCTION__,
+ strerror(errno));
+ }
close(conf->lock_fd);
}