From cad28d28e6e473a24822d7dfb17c449955e37157 Mon Sep 17 00:00:00 2001 From: mycroft Date: Tue, 8 Feb 1994 05:09:26 +0000 Subject: [PATCH] Fix core dump when source is a directory. --- bin/ln/ln.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/ln/ln.c b/bin/ln/ln.c index 89912cd9ab4c..5beb67c08754 100644 --- a/bin/ln/ln.c +++ b/bin/ln/ln.c @@ -39,7 +39,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)ln.c 4.15 (Berkeley) 2/24/91";*/ -static char rcsid[] = "$Id: ln.c,v 1.7 1994/01/27 02:00:45 jtc Exp $"; +static char rcsid[] = "$Id: ln.c,v 1.8 1994/02/08 05:09:26 mycroft Exp $"; #endif /* not lint */ #include @@ -129,8 +129,8 @@ linkit(source, target, isdir) return(1); } /* only symbolic links to directories, unless -F option used */ - if (!dirflag && (buf.st_mode & S_IFMT) == S_IFDIR) { - warnx("%s: %s", source, EISDIR); + if (!dirflag && S_ISDIR(buf.st_mode)) { + warnx("%s: %s", source, strerror(EISDIR)); return(1); } }