if ((proc = popen(command, "r")) == NULL )
 {
  fprintf(stderr, "send_sql: Can not open pipe\n");
  return 2;
 }

 //Don't work without this hack!!!!
 fflush(proc);

Add a code snippet to your website: www.paste.org