diff --git a/src/cmd/5l/obj.c b/src/cmd/5l/obj.c index 202c2e80046..7c9cb1ae24d 100644 --- a/src/cmd/5l/obj.c +++ b/src/cmd/5l/obj.c @@ -252,6 +252,7 @@ main(int argc, char *argv[]) dtype = 4; if(outfile == 0) outfile = "5.out"; + unlink(outfile); cout = create(outfile, 1, 0775); if(cout < 0) { diag("%s: cannot create", outfile); diff --git a/src/cmd/6l/obj.c b/src/cmd/6l/obj.c index 66d1e7eedec..75fe3ca0313 100644 --- a/src/cmd/6l/obj.c +++ b/src/cmd/6l/obj.c @@ -337,6 +337,7 @@ main(int argc, char *argv[]) edatap = P; pc = 0; dtype = 4; + unlink(outfile); cout = create(outfile, 1, 0775); if(cout < 0) { diag("cannot create %s", outfile); diff --git a/src/cmd/8l/obj.c b/src/cmd/8l/obj.c index 5d230939d15..ce57521b7e3 100644 --- a/src/cmd/8l/obj.c +++ b/src/cmd/8l/obj.c @@ -306,6 +306,7 @@ main(int argc, char *argv[]) edatap = P; pc = 0; dtype = 4; + unlink(outfile); cout = create(outfile, 1, 0775); if(cout < 0) { diag("cannot create %s", outfile);