[PATCH] osmo-bsc[master]: abisip-find: Force stdout buffer flush

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Mon Mar 12 17:03:55 UTC 2018


Review at  https://gerrit.osmocom.org/7258

abisip-find: Force stdout buffer flush

If list-view is not enabled, then a line with the new BTS is printed to
stdout buffer. That's fine if stdout goes to the terminal, since it's
line buffered, but if abisip-find write to a pite or to a file, then the
buffer won't be flushed until a full page is full, which may take a
while, and produce delays in scripts using abisip-find.

Change-Id: I19f8c7f747fa7a130a436e5e07a8648932404bf0
---
M src/ipaccess/abisip-find.c
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/58/7258/1

diff --git a/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c
index a4ed93e..defe2e4 100644
--- a/src/ipaccess/abisip-find.c
+++ b/src/ipaccess/abisip-find.c
@@ -339,9 +339,10 @@
 			talloc_free(bs);
 		base_stations_bump(changed);
 		printf("RX: %u   \r", responses);
-		fflush(stdout);
-	} else
+	} else {
 		printf("%s\n", parse_response(ctx, buf, len));
+	}
+	fflush(stdout);
 }
 
 static int read_response(int fd)

-- 
To view, visit https://gerrit.osmocom.org/7258
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I19f8c7f747fa7a130a436e5e07a8648932404bf0
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list