title: Silencing output from tcpdump when using popen
body: <p>I am writing a program in C to analyze packets that are captured by tcpdump. In my program I use <code>popen</code> to open a pipe to a tcpdump process which captures the packets and dumps the raw data to stdout as shown below.</p>
  
  <pre><code>FILE *tcpdump = popen("tcpdump -s0 -w -", "r");
  </code></pre>
  
  <p>However, warnings and error messages from tcpdump go straight to stderr, which is displayed in the console. I would like to somehow hide these, so only the output from my program is shown.</p>
  
  <p>One way i tried was to append <code>2&gt;&amp;1</code> to the tcpdump command, but then my program would have to differentiate between tcpdump warnings/errors and the raw packet data.</p>
  
  <p>Is there an easy way to silence the stderr output from tcpdump?</p>