***SPAM*** [ofa-general] [PATCH 3/4] opensm/osm_log.c save log_max_size in subnet opt in MB

Eli Dorfman (Voltaire) dorfman.eli at gmail.com
Mon Jan 26 06:33:26 PST 2009


 save log_max_size in subnet opt in MB
 the max_size in the log object is converted to bytes.

Signed-off-by: Eli Dorfman <elid at voltaire.com>
---
 opensm/opensm/main.c    |    5 ++---
 opensm/opensm/osm_log.c |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/opensm/opensm/main.c b/opensm/opensm/main.c
index 0f7b822..de38056 100644
--- a/opensm/opensm/main.c
+++ b/opensm/opensm/main.c
@@ -778,9 +778,8 @@ int main(int argc, char *argv[])
 			break;
 
 		case 'L':
-			opt.log_max_size =
-			    strtoul(optarg, NULL, 0) * (1024 * 1024);
-			printf(" Log file max size is %lu bytes\n",
+			opt.log_max_size = strtoul(optarg, NULL, 0);
+			printf(" Log file max size is %lu MBytes\n",
 			       opt.log_max_size);
 			break;
 
diff --git a/opensm/opensm/osm_log.c b/opensm/opensm/osm_log.c
index 88633ab..d5e1af6 100644
--- a/opensm/opensm/osm_log.c
+++ b/opensm/opensm/osm_log.c
@@ -306,7 +306,7 @@ ib_api_status_t osm_log_init_v2(IN osm_log_t * const p_log,
 	p_log->level = log_flags;
 	p_log->flush = flush;
 	p_log->count = 0;
-	p_log->max_size = max_size;
+	p_log->max_size = max_size << 20; /* convert size in MB to bytes */
 	p_log->accum_log_file = accum_log_file;
 	p_log->log_file_name = (char *)log_file;
 
-- 
1.5.5





More information about the general mailing list