Hi!
> +                     if ((st.st_mode & S_IFBLK) && (st.st_rdev == devt)) {
> +                             valid_node_created = 1;
> +                             break;
>                       }
>               }
> +
> +             sleep(1);

I would be inclined to check at least ten times in second. I.e.
usleep(100000); here and do the for loop 50 times instead.

Each second we spend doing nothing is second not spend doing actual
testing.

> +     }
> +
> +     if (!valid_node_created) {

Maybe we should issue TINFO message here that device wasn't created by
udev and we have fallen back to manual creation.

> +             if (unlink(DEVICE_NAME) && (errno != ENOENT))
> +                     tst_brkm(TBROK | TERRNO, cleanup, "unlink() failed");
> +             if (mknod(DEVICE_NAME, S_IFBLK | S_IRUSR | S_IWUSR |
> +                       S_IRGRP | S_IWGRP, devt))
> +                     tst_brkm(TBROK | TERRNO, cleanup, "mknod() failed");
>       }

Otherwise this looks good.

-- 
Cyril Hrubis
chru...@suse.cz

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to