rpm2cpio: handle bz2 too; code shrink
[oweals/busybox.git] / coreutils / pwd.c
index d96f6a8e5219fb67b9624b7d47884ec2c7beee8f..57953d246dd24d2e3191118750a5697f377c5be7 100644 (file)
@@ -7,19 +7,20 @@
  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include "busybox.h"
+#include "libbb.h"
 
-int pwd_main(int argc, char **argv);
-int pwd_main(int argc, char **argv)
+/* This is a NOFORK applet. Be very careful! */
+
+int pwd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+int pwd_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
 {
        char *buf;
 
        buf = xrealloc_getcwd_or_warn(NULL);
        if (buf != NULL) {
                puts(buf);
-               fflush_stdout_and_exit(EXIT_SUCCESS);
+               free(buf);
+               return fflush(stdout);
        }
 
        return EXIT_FAILURE;