From 98acf192dfcde709aeee5eb8cbaea806e84a6d42 Mon Sep 17 00:00:00 2001 From: pixdamix Date: Tue, 17 Nov 2009 06:17:42 -0500 Subject: 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 --- (limited to 'libopkg') 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); } -- cgit v0.9.1