Patchwork [1/5] windows-nat: Don't use ternary conditional operator in get_windows_debug_event

login
register
mail settings
Submitter Jon TURNEY
Date April 16, 2015, 7:23 p.m.
Message ID <1429212209-20548-2-git-send-email-jon.turney@dronecode.org.uk>
Download mbox | patch
Permalink /patch/6264/
State New
Headers show

Comments

Jon TURNEY - April 16, 2015, 7:23 p.m.
gdb/ChangeLog:

2015-04-16  Jon Turney  <jon.turney@dronecode.org.uk>

	* windows-nat.c (get_windows_debug_event): Don't use ternary
	conditional operator.
---
 gdb/ChangeLog     | 5 +++++
 gdb/windows-nat.c | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)
Joel Brobecker - April 22, 2015, 1:50 p.m.
> 2015-04-16  Jon Turney  <jon.turney@dronecode.org.uk>
> 
> 	* windows-nat.c (get_windows_debug_event): Don't use ternary
> 	conditional operator.

Looks good, please go ahead and push.

Thanks, Jon.

Patch

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index fd31083..dea4368 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -1502,7 +1502,9 @@  get_windows_debug_event (struct target_ops *ops,
     {
       inferior_ptid = ptid_build (current_event.dwProcessId, 0,
 				  retval);
-      current_thread = th ?: thread_rec (current_event.dwThreadId, TRUE);
+      current_thread = th;
+      if (!current_thread)
+	current_thread = thread_rec (current_event.dwThreadId, TRUE);
     }
 
 out: