misc cleanups to linux_nat_close

Message ID yjt2a971tmpy.fsf@ruffy.mtv.corp.google.com
State New, archived
Headers

Commit Message

Doug Evans Aug. 18, 2014, 11:14 p.m. UTC
  Hi.

I think this falls under obvious, but in case anyone wants to comment ...

2014-08-18  Doug Evans  <dje@google.com>

	* linux-nat.c (linux_nat_close): Don't pass NULL for "this".
	Pass NULL instead of 0 for context pointer.
  

Comments

Pedro Alves Aug. 19, 2014, 4:53 p.m. UTC | #1
On 08/19/2014 12:14 AM, Doug Evans wrote:
> Hi.
> 
> I think this falls under obvious, but in case anyone wants to comment ...

Yeah, it was one of those "to fix later" things, while to_close didn't
gain a self pointer:

 https://sourceware.org/ml/gdb-patches/2014-01/msg00424.html

Thanks for doing this.
  
Doug Evans Aug. 25, 2014, 7:20 p.m. UTC | #2
On Tue, Aug 19, 2014 at 9:53 AM, Pedro Alves <palves@redhat.com> wrote:
> On 08/19/2014 12:14 AM, Doug Evans wrote:
>> Hi.
>>
>> I think this falls under obvious, but in case anyone wants to comment ...
>
> Yeah, it was one of those "to fix later" things, while to_close didn't
> gain a self pointer:
>
>  https://sourceware.org/ml/gdb-patches/2014-01/msg00424.html
>
> Thanks for doing this.
>
> --
> Pedro Alves
>
>>
>> 2014-08-18  Doug Evans  <dje@google.com>
>>
>>       * linux-nat.c (linux_nat_close): Don't pass NULL for "this".
>>       Pass NULL instead of 0 for context pointer.
>>
>> diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
>> index 1e8991d..0898442 100644
>> --- a/gdb/linux-nat.c
>> +++ b/gdb/linux-nat.c
>> @@ -4813,8 +4813,8 @@ static void
>>  linux_nat_close (struct target_ops *self)
>>  {
>>    /* Unregister from the event loop.  */
>> -  if (linux_nat_is_async_p (NULL))
>> -    linux_nat_async (NULL, NULL, 0);
>> +  if (linux_nat_is_async_p (self))
>> +    linux_nat_async (self, NULL, NULL);
>>
>>    if (linux_ops->to_close)
>>      linux_ops->to_close (linux_ops);

Pushed.
  

Patch

diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 1e8991d..0898442 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -4813,8 +4813,8 @@  static void
 linux_nat_close (struct target_ops *self)
 {
   /* Unregister from the event loop.  */
-  if (linux_nat_is_async_p (NULL))
-    linux_nat_async (NULL, NULL, 0);
+  if (linux_nat_is_async_p (self))
+    linux_nat_async (self, NULL, NULL);
 
   if (linux_ops->to_close)
     linux_ops->to_close (linux_ops);