diff -Naur a/toys/posix/ln.c b/toys/posix/ln.c
--- a/toys/posix/ln.c	2014-10-02 18:23:27.000000000 +0530
+++ b/toys/posix/ln.c	2014-10-07 09:38:17.876601625 +0530
@@ -46,19 +46,30 @@
 
   for (i=0; i<toys.optc; i++) {
     int rc;
-    char *try = toys.optargs[i];
+    char *tmp = NULL, *try = toys.optargs[i];
 
     if (S_ISDIR(buf.st_mode)) new = xmprintf("%s/%s", dest, basename(try));
     else new = dest;
-    // Silently unlink the existing target (if any)
-    if (toys.optflags & FLAG_f) unlink(new);
+    // unlink the existing target (if any) after the successful operation
+    if (toys.optflags & FLAG_f) {
+      tmp = xmprintf("%s_XXXXXX",new);
+      rc = mkstemp(tmp);
+      if (rc >= 0) {
+        close(rc);
+        rename(new, tmp);
+      }
+    }
 
     rc = (toys.optflags & FLAG_s) ? symlink(try, new) : link(try, new);
-    if (rc)
-      perror_exit("cannot create %s link from '%s' to '%s'",
+    if (rc) {
+      perror_msg("cannot create %s link from '%s' to '%s'",
         (toys.optflags & FLAG_s) ? "symbolic" : "hard", try, new);
-    else if (toys.optflags & FLAG_v)
-      fprintf(stderr, "'%s' -> '%s'\n", new, try);
+      if (toys.optflags & FLAG_f) toys.exitval = rename(tmp, new);
+    } else {
+      if (toys.optflags & FLAG_v) fprintf(stderr, "'%s' -> '%s'\n", new, try);
+      if (toys.optflags & FLAG_f) toys.exitval = unlink(tmp);
+    }
     if (new != dest) free(new);
+    free(tmp);
   }
 }
