cosmetics
This commit is contained in:
@@ -358,25 +358,25 @@ METHOD(pts_t, destroy, void,
|
|||||||
/**
|
/**
|
||||||
* Determine Linux distribution and hardware platform
|
* Determine Linux distribution and hardware platform
|
||||||
*/
|
*/
|
||||||
char* extract_platform_info(void)
|
static char* extract_platform_info(void)
|
||||||
{
|
{
|
||||||
FILE *file;
|
FILE *file;
|
||||||
const char description[] = "Description:";
|
const char description[] = "Description:";
|
||||||
char buf[BUF_LEN], *pos, *value;
|
char buf[BUF_LEN], *pos, *value;
|
||||||
int value_len;
|
int value_len;
|
||||||
|
|
||||||
/* Open a pipe stream for reading the output of the lsb_release commmand */
|
/* open a pipe stream for reading the output of the lsb_release commmand */
|
||||||
file = popen("/usr/bin/lsb_release -d" , "r");
|
file = popen("/usr/bin/lsb_release -d" , "r");
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
DBG1(DBG_IMC, "Failed to run lsb_release command");
|
DBG2(DBG_IMC, "failed to run lsb_release command");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read the output the lsb_release command */
|
/* read the output the lsb_release command */
|
||||||
if (!fgets(buf, BUF_LEN-1, file))
|
if (!fgets(buf, BUF_LEN-1, file))
|
||||||
{
|
{
|
||||||
DBG1(DBG_IMC, "Failed to read output of lsb_release command");
|
DBG2(DBG_IMC, "failed to read output of lsb_release command");
|
||||||
pclose(file);
|
pclose(file);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -385,7 +385,7 @@ char* extract_platform_info(void)
|
|||||||
pos = strstr(buf, description);
|
pos = strstr(buf, description);
|
||||||
if (!pos)
|
if (!pos)
|
||||||
{
|
{
|
||||||
DBG1(DBG_IMC, "Failed to find lsb_release description field");
|
DBG2(DBG_IMC, "failed to find lsb_release description field");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
value = pos + strlen(description);
|
value = pos + strlen(description);
|
||||||
@@ -401,18 +401,18 @@ char* extract_platform_info(void)
|
|||||||
memcpy(buf, value, value_len);
|
memcpy(buf, value, value_len);
|
||||||
buf[value_len] = ' ';
|
buf[value_len] = ' ';
|
||||||
|
|
||||||
/* Open a pipe stream for reading the output of the uname commmand */
|
/* open a pipe stream for reading the output of the uname commmand */
|
||||||
file = popen("/bin/uname -p" , "r");
|
file = popen("/bin/uname -p" , "r");
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
DBG1(DBG_IMC, "Failed to run uname command");
|
DBG2(DBG_IMC, "failed to run uname command");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read the output the uname command */
|
/* Read the output the uname command */
|
||||||
if (!fgets(buf + value_len + 1, BUF_LEN - value_len - 2, file))
|
if (!fgets(buf + value_len + 1, BUF_LEN - value_len - 2, file))
|
||||||
{
|
{
|
||||||
DBG1(DBG_IMC, "Failed to read output of uname command");
|
DBG2(DBG_IMC, "failed to read output of uname command");
|
||||||
pclose(file);
|
pclose(file);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user