From 397f03378fc76a3eb60bfbc4f7c4228abfad225a Mon Sep 17 00:00:00 2001 From: schwarze Date: Wed, 7 May 2014 12:37:04 +0000 Subject: [PATCH] Remove the undocumented and ineffective -F option (force hard link to directory). This doesn't reduce functionality but merely results in a better error message when trying to use the option, and it simplifies the code. The -f option first appeared in AT&T Version 7 UNIX (1979), and Keith Bostic renamed it to -F for 4.3BSD-Reno in 1990 because it conflicted with System V and POSIX. Meanwhile, NetBSD, FreeBSD, and DragonFly removed it, too. From Tristan Le Guern . OK guenther@ krw@ --- bin/ln/ln.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/bin/ln/ln.c b/bin/ln/ln.c index c5c40e7c409..5a6dd9b1ba5 100644 --- a/bin/ln/ln.c +++ b/bin/ln/ln.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ln.c,v 1.19 2013/03/12 06:00:05 guenther Exp $ */ +/* $OpenBSD: ln.c,v 1.20 2014/05/07 12:37:04 schwarze Exp $ */ /* $NetBSD: ln.c,v 1.10 1995/03/21 09:06:10 cgd Exp $ */ /* @@ -42,7 +42,6 @@ #include #include -int dirflag; /* Undocumented directory flag. */ int fflag; /* Unlink existing files. */ int hflag; /* Check new name for symlink first. */ int Pflag; /* Hard link to symlink. */ @@ -58,11 +57,8 @@ main(int argc, char *argv[]) int ch, exitval; char *sourcedir; - while ((ch = getopt(argc, argv, "FfhLnPs")) != -1) + while ((ch = getopt(argc, argv, "fhLnPs")) != -1) switch (ch) { - case 'F': - dirflag = 1; /* XXX: deliberately undocumented. */ - break; case 'f': fflag = 1; break; @@ -126,8 +122,8 @@ linkit(char *target, char *source, int isdir) warn("%s", target); return (1); } - /* Only symbolic links to directories, unless -F option used. */ - if (!dirflag && S_ISDIR(sb.st_mode)) { + /* Only symbolic links to directories. */ + if (S_ISDIR(sb.st_mode)) { errno = EISDIR; warn("%s", target); return (1); -- 2.20.1