]> err.no Git - util-linux/commit
tailf: clean up gcc warnings & fix use of errno
authorKarel Zak <kzak@redhat.com>
Wed, 3 Oct 2007 21:15:03 +0000 (14:15 -0700)
committerKarel Zak <kzak@redhat.com>
Thu, 11 Oct 2007 11:19:55 +0000 (13:19 +0200)
commit642035150ec8fcb76244cf8475c5efdc7541760d
tree0a40ff376bc9cf04f6556c42454a2f39c9422951
parent830d6af09972a79ae7a6786afcb567d9d2cd5d24
tailf: clean up gcc warnings & fix use of errno

Fix strict gcc warnings in tailf that come from using:
  ("-Wall -Wp,-D_FORTIFY_SOURCE=2")

tailf.c:111: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result

Also, tailf uses perror() for error reporting, but it inserts
an fprintf call first, so perror() is actually reporting the
result of the fprintf() call, not the failing call; change
the code to print the message by using strerror() instead.

Builds cleanly on x86_32 and x86_64.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
text-utils/tailf.c