From 599a8de01ab3f9f78fbaea34612deaa1481845ca Mon Sep 17 00:00:00 2001 From: Andrew McCall Date: Mon, 19 Aug 2002 13:13:25 +0000 Subject: [PATCH] Added pwd to the Jamfiles, changed the returns to use B error codes rather than exit()'s. Andrew McCall git-svn-id: file:///srv/svn/repos/haiku/trunk/current@825 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/Jamfile | 12 ++++++++++++ src/kernel/apps/Jamfile | 1 + src/kernel/apps/pwd/main.c | 22 ++++++++++++++-------- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/kernel/Jamfile b/src/kernel/Jamfile index a96c32e65a..cf94ad5ef2 100644 --- a/src/kernel/Jamfile +++ b/src/kernel/Jamfile @@ -769,6 +769,18 @@ KernelLd uname : bin/uname ; +KernelLd pwd : + libglue2.o + <$(SOURCE_GRIST)!apps!pwd>main.o + libc.so + : + $(SUBDIR)/ldscripts/$(OBOS_ARCH)/app.ld + : + : + : + bin/pwd + ; + WriteKernelConfig $(OBOS_KERNEL_CONFIG) ; BuildKernel $(OBOS_KERNEL) : $(OBOS_KERNEL_CONFIG) ; diff --git a/src/kernel/apps/Jamfile b/src/kernel/apps/Jamfile index 8d14ae3981..97f1302b7c 100644 --- a/src/kernel/apps/Jamfile +++ b/src/kernel/apps/Jamfile @@ -16,3 +16,4 @@ SubInclude OBOS_TOP src kernel apps envtest ; SubInclude OBOS_TOP src kernel apps testapp ; SubInclude OBOS_TOP src kernel apps tests ; SubInclude OBOS_TOP src kernel apps uname ; +SubInclude OBOS_TOP src kernel apps pwd ; diff --git a/src/kernel/apps/pwd/main.c b/src/kernel/apps/pwd/main.c index 870a43a26a..2784d346b7 100644 --- a/src/kernel/apps/pwd/main.c +++ b/src/kernel/apps/pwd/main.c @@ -45,7 +45,8 @@ #include static char *getcwd_logical(void); -void usage(void); +//void usage(void); +int usage(void); int main(int argc, char *argv[]) @@ -80,20 +81,25 @@ main(int argc, char *argv[]) if ((!physical && (p = getcwd_logical()) != NULL) || (p = getcwd(NULL, 0)) != NULL) printf("%s\n", p); - else - //err(1, "."); Taken a quick look at this - // perhaps it could be replaced with - // just an exit(1) ? Andrew McCall + //else + // err(1, "."); Taken a quick look at this + // perhaps it could be replaced with + // just an exit(1) ? Andrew McCall + - exit(0); + //exit(0); + return B_NO_ERROR; } -void + +//void +int usage(void) { (void)fprintf(stderr, "usage: pwd [-LP]\n"); - exit(1); + //exit(1); + return B_ERROR; } static char *