1 /* vi: set sw=4 ts=4: */
3 /* BB_AUDIT SUSv3 N/A -- Apparently a busybox extension. */
5 /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org)
7 * Now does proper error checking on output and returns a failure exit code
8 * if one or more paths cannot be resolved.
10 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
15 int realpath_main(int argc
, char **argv
) MAIN_EXTERNALLY_VISIBLE
;
16 int realpath_main(int argc UNUSED_PARAM
, char **argv
)
18 int retval
= EXIT_SUCCESS
;
25 char *resolved_path
= xmalloc_realpath(*argv
);
26 if (resolved_path
!= NULL
) {
30 retval
= EXIT_FAILURE
;
31 bb_simple_perror_msg(*argv
);
35 fflush_stdout_and_exit(retval
);