diff mbox

opensm: accept looonnng partition.conf lines

Message ID 20110124193615.GP10691@sgi.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Arthur Kepner Jan. 24, 2011, 7:36 p.m. UTC
None
diff mbox

Patch

diff --git a/opensm/opensm/osm_prtn_config.c b/opensm/opensm/osm_prtn_config.c
index 0d02597..34676ef 100644
--- a/opensm/opensm/osm_prtn_config.c
+++ b/opensm/opensm/osm_prtn_config.c
@@ -400,7 +400,9 @@  skip_header:
 int osm_prtn_config_parse_file(osm_log_t * p_log, osm_subn_t * p_subn,
 			       const char *file_name)
 {
-	char line[1024];
+	char *line = NULL;
+	ssize_t llen;
+	size_t n;
 	struct part_conf *conf = NULL;
 	FILE *file;
 	int lineno;
@@ -415,7 +417,7 @@  int osm_prtn_config_parse_file(osm_log_t * p_log, osm_subn_t * p_subn,
 
 	lineno = 0;
 
-	while (fgets(line, sizeof(line) - 1, file) != NULL) {
+	while ((llen = getline(&line, &n, file)) != -1) {
 		char *q, *p = line;
 
 		lineno++;
@@ -463,6 +465,8 @@  int osm_prtn_config_parse_file(osm_log_t * p_log, osm_subn_t * p_subn,
 		} while (q);
 	}
 
+	free(line);
+
 	fclose(file);
 
 	return 0;