* Finish up the friendly name on ReadyNAS.

This commit is contained in:
Justin Maggard 2011-02-18 00:00:16 +00:00
parent ea1695b0b5
commit f190964ab1

View File

@ -227,18 +227,17 @@ getfriendlyname(char * buf, int len)
#ifdef READYNAS
FILE * info;
char ibuf[64], *key, *val;
snprintf(buf+off, len-off, "ReadyNAS");
info = fopen("/proc/sys/dev/boot/info", "r");
if( !info )
{
snprintf(buf+off, len-off, "ReadyNAS");
return;
}
while( (val = fgets(ibuf, 64, info)) != NULL )
{
key = strsep(&val, ": \t");
val = trim(val);
if( strcmp(key, "model") == 0 )
{
snprintf(buf+off, len-off, "%s", val);
key = strchr(val, ' ');
if( key )
{