Switch the inferior before outputting its id in "info inferiors"
[deliverable/binutils-gdb.git] / libctf / ctf-archive.c
index 8de11d6d583e8a892623b8d125d31b30d563429a..73d772ffc3846e2d7a4c1c12c9a78b74589f72ca 100644 (file)
@@ -1,5 +1,5 @@
 /* CTF archive files.
-   Copyright (C) 2019 Free Software Foundation, Inc.
+   Copyright (C) 2019-2020 Free Software Foundation, Inc.
 
    This file is part of libctf.
 
@@ -267,6 +267,9 @@ arc_write_one_ctf (ctf_file_t * f, int fd, size_t threshold)
   size_t ctfsz_len;
   int (*writefn) (ctf_file_t * fp, int fd);
 
+  if (ctf_serialize (f) < 0)
+    return f->ctf_errno * -1;
+
   if ((off = lseek (fd, 0, SEEK_CUR)) < 0)
     return errno * -1;
 
@@ -436,6 +439,8 @@ ctf_arc_close (ctf_archive_t *arc)
   free ((void *) arc->ctfi_symsect.cts_data);
   /* Do not free the ctfi_strsect: it is bound to the bfd.  */
   free (arc->ctfi_data);
+  if (arc->ctfi_bfd_close)
+    arc->ctfi_bfd_close (arc);
   free (arc);
 }
 
This page took 0.024865 seconds and 4 git commands to generate.