Add missing make_cleanup_close ().

Andrew Cagney ac131313@cygnus.com
Tue May 23 07:46:00 GMT 2000


FYI,

The attached slipped through (thanks Mark K for noticing it).

	Andrew
Wed May 24 00:38:09 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* utils.c (make_cleanup_close, do_close_cleanup): New functions.
	* defs.h (make_cleanup_close): Add declaration.

Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.20
diff -p -r1.20 defs.h
*** defs.h	2000/05/22 02:07:18	1.20
--- defs.h	2000/05/23 14:41:10
*************** extern struct cleanup *make_cleanup_free
*** 332,337 ****
--- 332,339 ----
  struct ui_file;
  extern struct cleanup *make_cleanup_ui_file_delete (struct ui_file *);
  
+ extern struct cleanup *make_cleanup_close (int fd);
+ 
  extern struct cleanup *make_cleanup_bfd_close (bfd *abfd);
  
  extern struct cleanup *make_final_cleanup (make_cleanup_ftype *, void *);
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.12
diff -p -r1.12 utils.c
*** utils.c	2000/05/22 02:07:19	1.12
--- utils.c	2000/05/23 14:41:14
*************** make_cleanup_bfd_close (bfd *abfd)
*** 216,221 ****
--- 216,234 ----
  }
  
  static void
+ do_close_cleanup (void *arg)
+ {
+   close ((int) arg);
+ }
+ 
+ struct cleanup *
+ make_cleanup_close (int fd)
+ {
+   /* int into void*. Outch!! */
+   return make_cleanup (do_close_cleanup, (void *) fd);
+ }
+ 
+ static void
  do_ui_file_delete (void *arg)
  {
    ui_file_delete (arg);


More information about the Gdb-patches mailing list