* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/*
#ifdef G_OS_WIN32
#include <fcntl.h>
#include <io.h>
+#define pipe(fds) _pipe(fds, 4096, _O_BINARY)
#endif
gchar **argv = 0;
#endif
- printf ("The following errors are supposed to occur:\n");
-
err = NULL;
if (!g_spawn_command_line_sync ("nonexistent_application foo 'bar baz' blah blah",
NULL, NULL, NULL,
&err))
{
- fprintf (stderr, "Error (normal, supposed to happen): %s\n", err->message);
g_error_free (err);
}
+ else
+ {
+ g_warning ("no error for sync spawn of nonexistent application");
+ exit (1);
+ }
err = NULL;
if (!g_spawn_command_line_async ("nonexistent_application foo bar baz \"blah blah\"",
&err))
{
- fprintf (stderr, "Error (normal, supposed to happen): %s\n", err->message);
g_error_free (err);
}
+ else
+ {
+ g_warning ("no error for async spawn of nonexistent application");
+ exit (1);
+ }
- printf ("Errors after this are not supposed to happen:\n");
-
err = NULL;
#ifdef G_OS_UNIX
if (!g_spawn_command_line_sync ("/bin/sh -c 'echo hello'",
}
#else
#ifdef G_OS_WIN32
- printf ("Running ipconfig synchronously, collecting its output\n");
+ printf ("Running netstat synchronously, collecting its output\n");
- if (!g_spawn_command_line_sync ("ipconfig /all",
+ if (!g_spawn_command_line_sync ("netstat -n",
&output, &erroutput, NULL,
&err))
{
g_assert (output != NULL);
g_assert (erroutput != NULL);
- if (strstr (output, "IP Configuration") == 0)
+ if (strstr (output, "Active Connections") == 0)
{
- printf ("output was '%s', should have contained 'IP Configuration'\n",
+ printf ("output was '%s', should have contained 'Active Connections'\n",
output);
exit (1);