redirect stderr of command to /dev/null
authorAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 8 Sep 2011 16:29:52 +0000 (18:29 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 8 Sep 2011 16:29:52 +0000 (18:29 +0200)
src/libpts/pts/pts.c

index c9df3f3..d1e6b59 100644 (file)
@@ -365,10 +365,10 @@ static char* extract_platform_info(void)
        int value_len;
 
        /* 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 2> /dev/null" , "r");
        if (!file)
        {
-               DBG2(DBG_IMC, "failed to run lsb_release command");
+               DBG2(DBG_IMC, "popen failed for lsb_release command");
                return NULL;
        }
 
@@ -401,10 +401,10 @@ static char* extract_platform_info(void)
        buf[value_len] = ' ';
 
        /* open a pipe stream for reading the output of the arch commmand */
-       file = popen("/usr/bin/arch" , "r");
+       file = popen("/usr/bin/arch 2> /dev/null" , "r");
        if (!file)
        {
-               DBG2(DBG_IMC, "failed to run arch command");
+               DBG2(DBG_IMC, "popen failed for arch command");
                return NULL;
        }