dont need lstat any more
authorBill Joy <root@ucbvax.Berkeley.EDU>
Thu, 1 Apr 1982 03:02:02 +0000 (19:02 -0800)
committerBill Joy <root@ucbvax.Berkeley.EDU>
Thu, 1 Apr 1982 03:02:02 +0000 (19:02 -0800)
SCCS-vsn: bin/ln/ln.c 4.3

usr/src/bin/ln/ln.c

index 868b590..2d6df4b 100644 (file)
@@ -1,4 +1,4 @@
-static char sccsid[] = "@(#)ln.c 4.2 %G%";
+static char sccsid[] = "@(#)ln.c 4.3 %G%";
 /*
  * ln
  */
 /*
  * ln
  */
@@ -37,7 +37,7 @@ again:
                argc++;
        }
        if (sflag == 0 && argc > 2) {
                argc++;
        }
        if (sflag == 0 && argc > 2) {
-               if (lstat(argv[argc-1], &stb) < 0)
+               if (stat(argv[argc-1], &stb) < 0)
                        goto usage;
                if ((stb.st_mode&S_IFMT) != S_IFDIR) 
                        goto usage;
                        goto usage;
                if ((stb.st_mode&S_IFMT) != S_IFDIR) 
                        goto usage;
@@ -60,12 +60,12 @@ linkit(from, to)
        int (*linkf)() = sflag ? symlink : link;
 
        /* is target a directory? */
        int (*linkf)() = sflag ? symlink : link;
 
        /* is target a directory? */
-       if (sflag == 0 && fflag == 0 && lstat(from, &stb) >= 0
+       if (sflag == 0 && fflag == 0 && stat(from, &stb) >= 0
            && (stb.st_mode&S_IFMT) == S_IFDIR) {
                printf("%s is a directory\n", from);
                return (1);
        }
            && (stb.st_mode&S_IFMT) == S_IFDIR) {
                printf("%s is a directory\n", from);
                return (1);
        }
-       if (lstat(to, &stb) >= 0 && (stb.st_mode&S_IFMT) == S_IFDIR) {
+       if (stat(to, &stb) >= 0 && (stb.st_mode&S_IFMT) == S_IFDIR) {
                tail = rindex(from, '/');
                if (tail == 0)
                        tail = from;
                tail = rindex(from, '/');
                if (tail == 0)
                        tail = from;