aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Barcroft <mike@FreeBSD.org>2002-02-11 18:38:54 +0000
committerMike Barcroft <mike@FreeBSD.org>2002-02-11 18:38:54 +0000
commit0dd10cae52da71a6ced663f3a3d2c237fdbe691f (patch)
tree96015be957f6ed4dc675b12b5657396086ad7719
parent19f56da943da4d0e4530ad85d19f421eccc85efd (diff)
downloadsrc-0dd10cae52da71a6ced663f3a3d2c237fdbe691f.tar.gz
src-0dd10cae52da71a6ced663f3a3d2c237fdbe691f.zip
o Remove old code from pwd(1); realpath(1) is now in its own directory.
o Fix some unordered includes in pwd(1). o Connect realpath(1) to the build.
Notes
Notes: svn path=/head/; revision=90535
-rw-r--r--bin/Makefile1
-rw-r--r--bin/pwd/Makefile2
-rw-r--r--bin/pwd/pwd.c20
3 files changed, 4 insertions, 19 deletions
diff --git a/bin/Makefile b/bin/Makefile
index 3fd3521db294..8c3bf238f23e 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -23,6 +23,7 @@ SUBDIR= cat \
ps \
pwd \
rcp \
+ realpath \
rm \
rmdir \
setfacl \
diff --git a/bin/pwd/Makefile b/bin/pwd/Makefile
index 129ed63cbdbe..4a8e66ac8320 100644
--- a/bin/pwd/Makefile
+++ b/bin/pwd/Makefile
@@ -2,7 +2,5 @@
# $FreeBSD$
PROG= pwd
-LINKS= ${BINDIR}/pwd ${BINDIR}/realpath
-MAN= pwd.1 realpath.1
.include <bsd.prog.mk>
diff --git a/bin/pwd/pwd.c b/bin/pwd/pwd.c
index 6302c28015e3..db5f2f369984 100644
--- a/bin/pwd/pwd.c
+++ b/bin/pwd/pwd.c
@@ -45,16 +45,15 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <sys/types.h>
+#include <sys/param.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <err.h>
#include <errno.h>
-#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <sys/param.h>
static char *getcwd_logical(void);
void usage(void);
@@ -65,16 +64,6 @@ main(int argc, char *argv[])
int Lflag, Pflag;
int ch;
char *p;
- char buf[PATH_MAX];
-
- if (strcmp(getprogname(), "realpath") == 0) {
- if (argc != 2)
- usage();
- if ((p = realpath(argv[1], buf)) == NULL)
- err(1, "%s", argv[1]);
- (void)printf("%s\n", p);
- exit(0);
- }
Lflag = Pflag = 0;
while ((ch = getopt(argc, argv, "LP")) != -1)
@@ -107,10 +96,7 @@ void
usage(void)
{
- if (strcmp(getprogname(), "realpath") == 0)
- (void)fprintf(stderr, "usage: realpath [path]\n");
- else
- (void)fprintf(stderr, "usage: pwd [-L | -P]\n");
+ (void)fprintf(stderr, "usage: pwd [-L | -P]\n");
exit(1);
}