Author: emaste
Date: Thu Mar 30 17:37:12 2017
New Revision: 316284
URL: https://svnweb.freebsd.org/changeset/base/316284

Log:
  elfcopy: remove temporary ELF file when converting from binary
  
  Previously a command like
  
    objcopy --input-target binary --output-target elf64-x86-64-freebsd \
      binary_file object.o
  
  would leave a temporary file behind.
  
  ELF Tool Chain ticket #543
  
  Reported by:  Roger Marquis
  MFC after:    2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/elftoolchain/elfcopy/main.c

Modified: head/contrib/elftoolchain/elfcopy/main.c
==============================================================================
--- head/contrib/elftoolchain/elfcopy/main.c    Thu Mar 30 17:31:12 2017        
(r316283)
+++ head/contrib/elftoolchain/elfcopy/main.c    Thu Mar 30 17:37:12 2017        
(r316284)
@@ -674,6 +674,8 @@ create_file(struct elfcopy *ecp, const c
                if ((ifd = open(elftemp, O_RDONLY)) == -1)
                        err(EXIT_FAILURE, "open %s failed", src);
                close(efd);
+               if (unlink(elftemp) < 0)
+                       err(EXIT_FAILURE, "unlink %s failed", elftemp);
                free(elftemp);
        }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to