]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: Remove trailing NULs from sysfs interface.
authorWagner Ferenc <wferi@niif.hu>
Fri, 7 Dec 2007 07:40:28 +0000 (23:40 -0800)
committerJeff Garzik <jeff@garzik.org>
Fri, 7 Dec 2007 20:00:18 +0000 (15:00 -0500)
commit712de60a8c19fa91b5f136cbf36ca04e07e57254
treeaecdf098f1bb5ef2e16afe9e6b63bfb87617bbfc
parent23b163a3b0c463855a532a0646b7c8a988bd91c6
bonding: Remove trailing NULs from sysfs interface.

From: Wagner Ferenc <wferi@niif.hu>

Also remove trailing spaces from multivalued files.

This fixes output like for example:

$ od -c /sys/class/net/bond0/bonding/slaves
0000000   e   t   h   -   l   e   f   t       e   t   h   -   r   i   g
0000020   h   t      \n  \0
0000025

It mostly entails deleting '+1'-s after sprintf() calls: the return value
of sprintf is the number of characters printed, without the closing NUL,
ie. exactly what the sysfs interface requires.  The three multivalue
cases are different, because they also have to swallow back a trailing
space.

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Acked-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/bonding/bond_sysfs.c