[2/2] Use warning in windows-nat error messages

Message ID 20220105204441.3088372-3-tom@tromey.com
State New
Headers show
Series
  • Two minor Windows changes
Related show

Commit Message

Tom Tromey Jan. 5, 2022, 8:44 p.m.
A warning in windows-nat.c can be converted to use the warning
function.  As a side effect, this arranges for the output to be sent
to gdb_stderr.
---
 gdb/windows-nat.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

-- 
2.31.1

Patch

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 03447e0922a..47760b7b8b8 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -1905,11 +1905,8 @@  windows_nat_target::attach (const char *args, int from_tty)
   pid = parse_pid_to_attach (args);
 
   if (set_process_privilege (SE_DEBUG_NAME, TRUE) < 0)
-    {
-      printf_unfiltered ("Warning: Failed to get SE_DEBUG_NAME privilege\n");
-      printf_unfiltered ("This can cause attach to "
-			 "fail on Windows NT/2K/XP\n");
-    }
+    warning ("Failed to get SE_DEBUG_NAME privilege\n"
+	     "This can cause attach to fail on Windows NT/2K/XP");
 
   windows_init_thread_list ();
   ok = DebugActiveProcess (pid);