Hi.
The patch has an error and I attach again.

diff --git a/toys/other/mountpoint.c b/toys/other/mountpoint.c
index 150865c..4dff978 100644
--- a/toys/other/mountpoint.c
+++ b/toys/other/mountpoint.c
@@ -33,7 +33,8 @@ void mountpoint_main(void)
   char *arg = *toys.optargs;
   int quiet = toys.optflags & FLAG_q;

-  if (lstat(arg, &st1)) perror_exit("%s", arg);
+  if (((toys.optflags & FLAG_x) ? stat:lstat)(arg, &st1))
+    perror_exit("%s", arg);

   if (toys.optflags & FLAG_x) {
     if (S_ISBLK(st1.st_mode)) {
-- 




2015-05-06 17:34 GMT+09:00 Hyejin Kim <[email protected]>:

> Hi.
>
> Mountpoint doesnt support symlink argument now.
> For example, "mountpoint -x symlink_path" displays wrong output.
>
> plz have a look.
>
>
>
> diff --git a/toys/other/mountpoint.c b/toys/other/mountpoint.c
> index 150865c..d7432c9 100644
> --- a/toys/other/mountpoint.c
> +++ b/toys/other/mountpoint.c
> @@ -33,7 +33,8 @@ void mountpoint_main(void)
>    char *arg = *toys.optargs;
>    int quiet = toys.optflags & FLAG_q;
>
> -  if (lstat(arg, &st1)) perror_exit("%s", arg);
> +  if ((toys.optflags & FLAG_x) && stat(arg, &st1) || lstat(arg, &st1))
> +    perror_exit("%s", arg);
>
>    if (toys.optflags & FLAG_x) {
>      if (S_ISBLK(st1.st_mode)) {
> --
>

Attachment: 0001-mountpoint-fix-to-support-symlink-argument-with-x-op.patch
Description: Binary data

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to