Use the "/sys/class/block" string directly
for the stat call. This makes the code simpler
and reduces stack usage.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
int main(int argc, char *argv[], char *envp[])
{
- char base[PATH_SIZE];
struct stat statbuf;
int option;
scan_class();
/* scan "block" if it isn't a "class" */
- strlcpy(base, "/sys/class/block", sizeof(base));
- if (stat(base, &statbuf) != 0)
+ if (stat("/sys/class/block", &statbuf) != 0)
scan_block();
exit: