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 <[email protected]>
---
 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


_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to