Apply a patch from Evin Robertson -- new pivot_root applet.
[oweals/busybox.git] / pwd.c
diff --git a/pwd.c b/pwd.c
index 71731944c57ee09d58a1025aaa588281233fdbb2..a9acbc721ad6fbebfd6082e086159541b1df79c1 100644 (file)
--- a/pwd.c
+++ b/pwd.c
 #include <stdio.h>
 #include <dirent.h>
 #include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
 
 extern int pwd_main(int argc, char **argv)
 {
        char buf[BUFSIZ + 1];
 
        if (getcwd(buf, sizeof(buf)) == NULL)
-               error_msg_and_die("%s\n", strerror(errno));
+               perror_msg_and_die("getcwd");
 
-       printf("%s\n", buf);
+       puts(buf);
        return EXIT_SUCCESS;
 }