summaryrefslogtreecommitdiff
path: root/src/ln.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-04-12 20:14:01 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-04-12 20:14:01 +0000
commite26a29be004c763c90a2cd6f6b58cc2a5bdbd253 (patch)
treeff2a0a778880006777278c0bd5cad3c94ccd1d7c /src/ln.c
parentcec6e43aaeeab8ea3079b369d26da8786a3d48a1 (diff)
downloadcoreutils-e26a29be004c763c90a2cd6f6b58cc2a5bdbd253.tar.xz
(linkfunc): Remove. This method ran into a compiler/linker
bug in Interix. Just call symlink or link directly. All uses changed.
Diffstat (limited to 'src/ln.c')
-rw-r--r--src/ln.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/ln.c b/src/ln.c
index 49163fde6..e0230b204 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -60,10 +60,6 @@ char *program_name;
/* FIXME: document */
static enum backup_type backup_type;
-/* A pointer to the function used to make links. This will point to either
- `link' or `symlink'. */
-static int (*linkfunc) ();
-
/* If true, make symbolic links; otherwise, make hard links. */
static bool symbolic_link;
@@ -241,7 +237,8 @@ do_link (const char *source, const char *dest)
}
}
- ok = (linkfunc (source, dest) == 0);
+ ok = ((symbolic_link ? symlink (source, dest) : link (source, dest))
+ == 0);
/* If the attempt to create a link failed and we are removing or
backing up destinations, unlink the destination and try again.
@@ -270,7 +267,8 @@ do_link (const char *source, const char *dest)
return false;
}
- ok = (linkfunc (source, dest) == 0);
+ ok = ((symbolic_link ? symlink (source, dest) : link (source, dest))
+ == 0);
}
if (ok)
@@ -506,11 +504,6 @@ main (int argc, char **argv)
quote (file[n_files - 1]));
}
- if (symbolic_link)
- linkfunc = symlink;
- else
- linkfunc = link;
-
if (backup_suffix_string)
simple_backup_suffix = xstrdup (backup_suffix_string);