#include <stdio.h>
#include <dirent.h>
+#include <string.h>
+#include <stdlib.h>
#include <errno.h>
+#include <unistd.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,
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, "/");
extern int ln_main(int argc, char **argv)
{
+ int status = EXIT_SUCCESS;
int flag = 0;
int opt;
}
while(optind<(argc-1)) {
if (fs_link(argv[optind], argv[argc-1], flag)==FALSE)
- return(FALSE);
+ status = EXIT_FAILURE;
optind++;
}
- return(TRUE);
+ return(status);
}
/*