[gdb] Fix clang buildbreaker
authorTom de Vries <tdevries@suse.de>
Wed, 19 Jun 2019 15:17:38 +0000 (17:17 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 19 Jun 2019 15:17:38 +0000 (17:17 +0200)
commit8d6a48df549cce08ba1f05350f592be52352c7e8
treebadc465157702dcc6fb8d975c45e39a4cf63896c
parentf23f598e28ad39dac7ae87cdc400d2f6b27dc403
[gdb] Fix clang buildbreaker

Building gdb with clang, I run into:
...
src/gdb/gdbserver/linux-low.c:6190:41: error: comparison of unsigned \
  expression < 0 is always false [-Werror,-Wtautological-compare]
          if (debug_write ("sigchld_handler\n",
                           sizeof ("sigchld_handler\n") - 1) < 0)
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
...

This regression is introduced by commit a7e559cc08 "gdbserver: Ensure all
debug output uses debug functions", which replaces calls to write with result
type ssize_t with calls to debug_write with result type size_t.

Fix this by making debug_write return ssize_t.

Build and reg-tested on x86_64-linux.

gdb/gdbserver/ChangeLog:

2019-06-19  Tom de Vries  <tdevries@suse.de>

* debug.h (debug_write): Change return type to ssize_t.
* debug.c (debug_write): Same.
gdb/gdbserver/ChangeLog
gdb/gdbserver/debug.c
gdb/gdbserver/debug.h