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

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


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 3562353e0e2039d90f99f5e1165e3d7899abde91
      https://github.com/openvswitch/ovs/commit/3562353e0e2039d90f99f5e1165e3d7899abde91
  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
line).

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