From b994b17be807c7041e8d29b628df238d2a0cb0c9 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Tue, 20 Mar 2012 12:39:40 -0700 Subject: [PATCH] Remove object file directly rather than running "rm". Close #1778 also. --- src/rustc/back/link.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rustc/back/link.rs b/src/rustc/back/link.rs index 4ff6e330797..5a05bc7c124 100644 --- a/src/rustc/back/link.rs +++ b/src/rustc/back/link.rs @@ -700,7 +700,10 @@ fn link_binary(sess: session, // Remove the temporary object file if we aren't saving temps if !sess.opts.save_temps { - run::run_program("rm", [obj_filename]); + if ! os::remove_file(obj_filename) { + sess.warn(#fmt["failed to delete object file '%s'", + obj_filename]); + } } } //