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:
parent
468048ccc3
commit
599a8de01a
@ -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) ;
|
||||
|
@ -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 ;
|
||||
|
@ -45,7 +45,8 @@
|
||||
#include <unistd.h>
|
||||
|
||||
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 *
|
||||
|
Loading…
Reference in New Issue
Block a user