On 05/31/2018 09:16 PM, Richard Henderson wrote:
> On 05/31/2018 04:15 PM, Philippe Mathieu-Daudé wrote:
>> Hi Richard,
>>
>> On 05/31/2018 07:49 PM, Richard Henderson wrote:
>>> This will allow us to protect gdbserver_fd from the guest.
>>>
>>> Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
>>> ---
>>>  gdbstub.c | 5 +++--
>>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/gdbstub.c b/gdbstub.c
>>> index 6081e719c5..057d0d65c5 100644
>>> --- a/gdbstub.c
>>> +++ b/gdbstub.c
>>> @@ -1890,15 +1890,16 @@ static int gdbserver_open(int port)
>>>  int gdbserver_start(int port)
>>>  {
>>>      gdbserver_fd = gdbserver_open(port);
>>> -    if (gdbserver_fd < 0)
>>> +    if (gdbserver_fd < 0) {
>>>          return -1;
>>> +    }
>>>      /* accept connections */
>>>      if (!gdb_accept()) {
>>>          close(gdbserver_fd);
>>>          gdbserver_fd = -1;
>>>          return -1;
>>>      }
>>> -    return 0;
>>> +    return gdbserver_fd;
>>
>> I agree with your change, but what about !CONFIG_USER_ONLY?
> 
> It's still a non-negative number, so the success value is still the same.

Good point.

Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org>


Reply via email to