public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Yevgeny Kliteynik <kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
Cc: Linux RDMA <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH] opensm/osm_sa.{c,h}: osm_sa_db_file_dump() return values
Date: Thu, 21 Jan 2010 17:54:13 +0200	[thread overview]
Message-ID: <4B5878A5.1080800@dev.mellanox.co.il> (raw)

Since osm_sa_db_file_dump() doesn't have to actually dump
SA DB, reflecting this in the function return values.

Function returns 0 if the SA DB was actually dumped,
>0 if there was no need to dump the SA DB and <0 if
some error occurred.

Signed-off-by: Yevgeny Kliteynik <kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
---
 opensm/include/opensm/osm_sa.h |    4 +++-
 opensm/opensm/osm_sa.c         |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/opensm/include/opensm/osm_sa.h b/opensm/include/opensm/osm_sa.h
index 9229d1a..d516310 100644
--- a/opensm/include/opensm/osm_sa.h
+++ b/opensm/include/opensm/osm_sa.h
@@ -436,7 +436,9 @@ int osm_sa_db_file_dump(struct osm_opensm *p_osm);
 *		[in] Pointer to an osm_opensm_t object.
 *
 * RETURN VALUES
-*	None
+*	 0 if the SA DB was actually dumped
+*	>0 if there was no need to dump the SA DB
+*	<0 if some error occurred.
 *
 *********/

diff --git a/opensm/opensm/osm_sa.c b/opensm/opensm/osm_sa.c
index 0d203ad..3473e4c 100644
--- a/opensm/opensm/osm_sa.c
+++ b/opensm/opensm/osm_sa.c
@@ -704,7 +704,7 @@ static void sa_dump_all_sa(osm_opensm_t * p_osm, FILE * file)

 int osm_sa_db_file_dump(osm_opensm_t * p_osm)
 {
-	int res = 0;
+	int res = 1;
 	if (p_osm->sa.dirty) {
 		res = opensm_dump_to_file(
 			p_osm, "opensm-sa.dump", sa_dump_all_sa);
-- 
1.5.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2010-01-21 15:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-21 15:54 Yevgeny Kliteynik [this message]
     [not found] ` <4B5878A5.1080800-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2010-01-25 17:52   ` [PATCH] opensm/osm_sa.{c,h}: osm_sa_db_file_dump() return values Sasha Khapyorsky

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=4B5878A5.1080800@dev.mellanox.co.il \
    --to=kliteyn-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sashak-smomgflXvOZWk0Htik3J/w@public.gmane.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