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 lib/filters/filter-mpath.c lib/metadata/m ...
Date: Wed, 08 Feb 2012 11:40:00 -0000	[thread overview]
Message-ID: <20120208114004.1425.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-08 11:40:03

Modified files:
	lib/filters    : filter-mpath.c 
	lib/metadata   : mirror.c 
	tools          : vgcfgbackup.c 

Log message:
	Replace snprintf with dm_snprintf
	
	snprintf testing for negative is replaced with dm_snprintf where this
	test really works.
	Add missing test for result of dm_snprintf().

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-mpath.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.176&r2=1.177
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgcfgbackup.c.diff?cvsroot=lvm2&r1=1.31&r2=1.32

--- LVM2/lib/filters/filter-mpath.c	2011/11/11 16:41:37	1.2
+++ LVM2/lib/filters/filter-mpath.c	2012/02/08 11:40:02	1.3
@@ -60,7 +60,7 @@
 {
 	char path[PATH_MAX], buffer[64];
 
-	if (snprintf(path, sizeof(path), "%s/block/%s/dev", sysfs_dir, kname) < 0)
+	if (dm_snprintf(path, sizeof(path), "%s/block/%s/dev", sysfs_dir, kname) < 0)
 		return_0;
 
 	if (!get_sysfs_string(path, buffer, sizeof(buffer)))
--- LVM2/lib/metadata/mirror.c	2012/02/01 15:05:53	1.176
+++ LVM2/lib/metadata/mirror.c	2012/02/08 11:40:02	1.177
@@ -696,9 +696,11 @@
 		dm_list_iterate_items(lvl, &split_images) {
 			sub_lv = lvl->lv;
 
-			dm_snprintf(format, len, "%s_mimage_%%d",
-				    new_lv->name);
-
+			if (dm_snprintf(format, len, "%s_mimage_%%d",
+					new_lv->name) < 0) {
+				log_error("Failed to build new image name.");
+				return 0;
+			}
 			layer_name = dm_pool_alloc(lv->vg->vgmem, len);
 			if (!layer_name) {
 				log_error("Unable to allocate memory");
--- LVM2/tools/vgcfgbackup.c	2009/09/15 01:38:59	1.31
+++ LVM2/tools/vgcfgbackup.c	2012/02/08 11:40:02	1.32
@@ -28,7 +28,7 @@
 		return NULL;
 	}
 
-	if (snprintf(filename, PATH_MAX, template, vg_name) < 0) {
+	if (dm_snprintf(filename, PATH_MAX, template, vg_name) < 0) {
 		log_error("Error processing filename template %s",
 			   template);
 		dm_free(filename);	


                 reply	other threads:[~2012-02-08 11:40 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=20120208114004.1425.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).