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
This commit is contained in:
Andrew McCall
2002-08-19 13:13:25 +00:00
parent 468048ccc3
commit 599a8de01a
3 changed files with 27 additions and 8 deletions
+12
View File
@@ -769,6 +769,18 @@ KernelLd uname :
bin/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) ; WriteKernelConfig $(OBOS_KERNEL_CONFIG) ;
BuildKernel $(OBOS_KERNEL) : $(OBOS_KERNEL_CONFIG) ; BuildKernel $(OBOS_KERNEL) : $(OBOS_KERNEL_CONFIG) ;
+1
View File
@@ -16,3 +16,4 @@ SubInclude OBOS_TOP src kernel apps envtest ;
SubInclude OBOS_TOP src kernel apps testapp ; SubInclude OBOS_TOP src kernel apps testapp ;
SubInclude OBOS_TOP src kernel apps tests ; SubInclude OBOS_TOP src kernel apps tests ;
SubInclude OBOS_TOP src kernel apps uname ; SubInclude OBOS_TOP src kernel apps uname ;
SubInclude OBOS_TOP src kernel apps pwd ;
+11 -5
View File
@@ -45,7 +45,8 @@
#include <unistd.h> #include <unistd.h>
static char *getcwd_logical(void); static char *getcwd_logical(void);
void usage(void); //void usage(void);
int usage(void);
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
@@ -80,20 +81,25 @@ main(int argc, char *argv[])
if ((!physical && (p = getcwd_logical()) != NULL) || if ((!physical && (p = getcwd_logical()) != NULL) ||
(p = getcwd(NULL, 0)) != NULL) (p = getcwd(NULL, 0)) != NULL)
printf("%s\n", p); printf("%s\n", p);
else //else
// err(1, "."); Taken a quick look at this // err(1, "."); Taken a quick look at this
// perhaps it could be replaced with // perhaps it could be replaced with
// just an exit(1) ? Andrew McCall // just an exit(1) ? Andrew McCall
exit(0);
//exit(0);
return B_NO_ERROR;
} }
void
//void
int
usage(void) usage(void)
{ {
(void)fprintf(stderr, "usage: pwd [-LP]\n"); (void)fprintf(stderr, "usage: pwd [-LP]\n");
exit(1); //exit(1);
return B_ERROR;
} }
static char * static char *