Fix possible bug when no args have been provided to the executable
[deliverable/binutils-gdb.git] / gdb / reggroups.c
index 693b378d87656019dfa033e56b0dbce351148c42..ae7d4ceeb722c29547fbcfe13d2e5a51a68b4030 100644 (file)
@@ -270,14 +270,11 @@ maintenance_print_reggroups (char *args, int from_tty)
     reggroups_dump (gdbarch, gdb_stdout);
   else
     {
-      struct cleanup *cleanups;
-      struct ui_file *file = gdb_fopen (args, "w");
+      stdio_file file;
 
-      if (file == NULL)
+      if (!file.open (args, "w"))
        perror_with_name (_("maintenance print reggroups"));
-      cleanups = make_cleanup_ui_file_delete (file);
-      reggroups_dump (gdbarch, file);
-      do_cleanups (cleanups);
+      reggroups_dump (gdbarch, &file);
     }
 }
 
This page took 0.033733 seconds and 4 git commands to generate.