public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: zkabelac@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2 daemons/clvmd/clvmd.c lib/misc/lvm-file.c ...
Date: Mon, 27 Feb 2012 11:28:00 -0000	[thread overview]
Message-ID: <20120227112849.3565.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-27 11:28:48

Modified files:
	daemons/clvmd  : clvmd.c 
	lib/misc       : lvm-file.c 
	tools          : dmsetup.c 

Log message:
	Add some log_sys_errors to close() call

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.c.diff?cvsroot=lvm2&r1=1.123&r2=1.124
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-file.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/dmsetup.c.diff?cvsroot=lvm2&r1=1.181&r2=1.182

--- LVM2/daemons/clvmd/clvmd.c	2012/02/27 11:26:25	1.123
+++ LVM2/daemons/clvmd/clvmd.c	2012/02/27 11:28:47	1.124
@@ -198,7 +198,8 @@
 	if (*fd >= 0) {
 		int to_close = *fd;
 		*fd = -1;
-		close(to_close);
+		if (close(to_close))
+			log_sys_error("close", ""); /* path */
 	}
 }
 
--- LVM2/lib/misc/lvm-file.c	2011/06/08 08:49:54	1.28
+++ LVM2/lib/misc/lvm-file.c	2012/02/27 11:28:47	1.29
@@ -253,7 +253,8 @@
 
 	if (fcntl(lockfd, F_SETLKW, &lock)) {
 		log_sys_error("fcntl", file);
-		close(lockfd);
+		if (close(lockfd))
+                        log_sys_error("close", file);
 		return -1;
 	}
 
--- LVM2/tools/dmsetup.c	2012/02/15 14:27:53	1.181
+++ LVM2/tools/dmsetup.c	2012/02/27 11:28:48	1.182
@@ -3240,7 +3240,8 @@
 	blksize = fsbuf.f_frsize;
 #endif
 
-	close(fd);
+	if (close(fd))
+                log_sys_error("close", file);
 
 	if (dm_snprintf(table, tlen, "%llu %llu loop %s %llu\n", 0ULL,
 			(long long unsigned)sectors, file, (long long unsigned)off) < 0)
@@ -3252,8 +3253,9 @@
 	return 1;
 
 error:
-	if (fd > -1)
-		close(fd);
+	if (fd > -1 && close(fd))
+		log_sys_error("close", file);
+
 	return 0;
 }
 


                 reply	other threads:[~2012-02-27 11:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120227112849.3565.qmail@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).