[RFC,07/17] Use warning in event-loop

Message ID 20190224165153.5062-8-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey Feb. 24, 2019, 4:51 p.m. UTC
  Change event-loop.c to avoid printf_unfiltered in favor of warning.
warning is aleady available to code in common/.

gdb/ChangeLog
2019-02-24  Tom Tromey  <tom@tromey.com>

	* event-loop.c (handle_file_event): Use warning, not
	printf_unfiltered.
---
 gdb/ChangeLog    |  5 +++++
 gdb/event-loop.c | 11 +++++------
 2 files changed, 10 insertions(+), 6 deletions(-)
  

Comments

Pedro Alves Sept. 26, 2019, 2:02 p.m. UTC | #1
On 2/24/19 4:51 PM, Tom Tromey wrote:
> Change event-loop.c to avoid printf_unfiltered in favor of warning.
> warning is aleady available to code in common/.
> 
> gdb/ChangeLog
> 2019-02-24  Tom Tromey  <tom@tromey.com>
> 
> 	* event-loop.c (handle_file_event): Use warning, not
> 	printf_unfiltered.

OK.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/event-loop.c b/gdb/event-loop.c
index 496111a01c6..caa910c9f82 100644
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -680,11 +680,10 @@  handle_file_event (file_handler *file_ptr, int ready_mask)
 		  /* Work in progress.  We may need to tell somebody
 		     what kind of error we had.  */
 		  if (mask & POLLERR)
-		    printf_unfiltered (_("Error detected on fd %d\n"),
-				       file_ptr->fd);
+		    warning (_("Error detected on fd %d"), file_ptr->fd);
 		  if (mask & POLLNVAL)
-		    printf_unfiltered (_("Invalid or non-`poll'able fd %d\n"),
-				       file_ptr->fd);
+		    warning (_("Invalid or non-`poll'able fd %d"),
+			     file_ptr->fd);
 		  file_ptr->error = 1;
 		}
 	      else
@@ -698,8 +697,8 @@  handle_file_event (file_handler *file_ptr, int ready_mask)
 	    {
 	      if (ready_mask & GDB_EXCEPTION)
 		{
-		  printf_unfiltered (_("Exception condition detected "
-				       "on fd %d\n"), file_ptr->fd);
+		  warning (_("Exception condition detected on fd %d"),
+			   file_ptr->fd);
 		  file_ptr->error = 1;
 		}
 	      else