[ovs-git] [openvswitch/ovs] ba2154: table: append newline when printing tables

GitHub noreply at github.com
Wed Aug 8 18:17:30 UTC 2018

  Branch: refs/heads/branch-2.10
  Home:   https://github.com/openvswitch/ovs
  Commit: ba215404e70f8445d4273f8d6542acb24c562714
  Author: Aaron Conole <aconole at redhat.com>
  Date:   2018-08-08 (Wed, 08 Aug 2018)

  Changed paths:
    M lib/table.c

  Log Message:
  table: append newline when printing tables

With commit cb139fa8b3a1 ("table: New function table_format() for
formatting a table as a string.") a new mechanism for formatting
tables was introduced, and the table_print method was refactored to
use this.

During that refactor, calls to 'puts' were replaced with
'ds_put_cstr', and table print was changed to use 'fputs(...,
stdout)'.  Unfortunately, fputs() does not append a newline to the
string provided, and changes the output strings of, for example,
ovsdb-client dump to print all on one line.  This means
post-processing scripts that are chained after ovsdb-client would
either block indefinitely (if they don't detect EOF), or process the
entire bundle at once (rather than seeing each table on a separate

Fixes: cb139fa8b3a1 ("table: New function table_format() for formatting a table as a string.")
Cc: Ben Pfaff <blp at ovn.org>
Cc: Jakub Sitnicki <jsitnicki at gmail.com>
Reported-by: Terry Wilson <twilson at redhat.com>
Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1608508
Signed-off-by: Aaron Conole <aconole at redhat.com>
Suggested-by: Ben Pfaff <blp at ovn.org>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Terry Wilson <twilson at redhat.com>
Tested-by: Terry Wilson <twilson at redhat.com>

      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

More information about the git mailing list