Add errno.h
[oweals/busybox.git] / ln.c
diff --git a/ln.c b/ln.c
index 38e9b6763a1cdc4e92457b410af544e6a66c84de..e69cb024a03cb1ab6fbb368b018c335b2dbd3483 100644 (file)
--- a/ln.c
+++ b/ln.c
@@ -30,9 +30,9 @@
 #include <dirent.h>
 #include <errno.h>
 
-#define LN_SYMLINK             1
-#define LN_FORCE                       2
-#define LN_NODEREFERENCE       4
+static const int LN_SYMLINK = 1;
+static const int LN_FORCE = 2;
+static const int LN_NODEREFERENCE = 4;
 
 /*
  * linkDestName is where the link points to,
@@ -55,9 +55,9 @@ static int fs_link(const char *link_DestName, const char *link_SrcName, const in
                strcpy(srcName, link_SrcName);
 
        if (flag&LN_NODEREFERENCE)
-               srcIsDir = isDirectory(srcName, TRUE, NULL);
+               srcIsDir = is_directory(srcName, TRUE, NULL);
        else
-               srcIsDir = isDirectory(srcName, FALSE, NULL);   
+               srcIsDir = is_directory(srcName, FALSE, NULL);  
        
        if ((srcIsDir==TRUE)&&((flag&LN_NODEREFERENCE)==0)) {
                strcat(srcName, "/");
@@ -81,6 +81,7 @@ static int fs_link(const char *link_DestName, const char *link_SrcName, const in
 
 extern int ln_main(int argc, char **argv)
 {
+       int status = EXIT_SUCCESS;
        int flag = 0;
        int opt;
        
@@ -102,10 +103,10 @@ extern int ln_main(int argc, char **argv)
        }
        while(optind<(argc-1)) {
                if (fs_link(argv[optind], argv[argc-1], flag)==FALSE)
-                       return(FALSE);
+                       status = EXIT_FAILURE;
                optind++;
        }
-       return(TRUE);
+       return(status);
 }
 
 /*