MIPS/LD: Continue processing with refused relocations in PIC code
[binutils-gdb.git] / gdb / psymtab.c
index 915e4fb58232e42c8e09bdfabcc0676c8ee8e20d..6d76e8d4898a00e3d607f194c11e24932cc6ebe7 100644 (file)
@@ -1129,12 +1129,11 @@ psymtab_to_fullname (struct partial_symtab *ps)
   if (ps->fullname == NULL)
     {
       gdb::unique_xmalloc_ptr<char> fullname;
-      int fd = find_and_open_source (ps->filename, ps->dirname, &fullname);
+      scoped_fd fd = find_and_open_source (ps->filename, ps->dirname,
+                                          &fullname);
       ps->fullname = fullname.release ();
 
-      if (fd >= 0)
-       close (fd);
-      else
+      if (fd.get () < 0)
        {
          /* rewrite_source_path would be applied by find_and_open_source, we
             should report the pathname where GDB tried to find the file.  */