summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2006-02-07 11:24:53 +0000
committerTor Lillqvist <tml@src.gnome.org>2006-02-07 11:24:53 +0000
commit2e4ef092318f3a4500b43f084d6ebfa2f691ab71 (patch)
treebea75fe12eefbb7f0f264b6837512af0c4ec9b61 /examples
parent47a9932944536e87ffabaa8208176628b7496be7 (diff)
downloadpango-2e4ef092318f3a4500b43f084d6ebfa2f691ab71.tar.gz
Initialise GError pointer to NULL. Use waitpid() only on Unix.
2006-02-07 Tor Lillqvist <tml@novell.com> * examples/viewer-main.c (main): Initialise GError pointer to NULL. Use waitpid() only on Unix.
Diffstat (limited to 'examples')
-rw-r--r--examples/viewer-main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/viewer-main.c b/examples/viewer-main.c
index 377b625a..7823025b 100644
--- a/examples/viewer-main.c
+++ b/examples/viewer-main.c
@@ -24,11 +24,14 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <sys/wait.h>
#include <glib.h>
#include <glib/gstdio.h>
+#ifdef G_OS_UNIX
+#include <sys/wait.h>
+#endif
+
#include "viewer.h"
#include "renderdemo.h"
@@ -123,7 +126,7 @@ main (int argc,
int fd;
FILE *stream;
const gchar *display_argv[5] = {"display", "-title", "%s", "-"};
- GError *error;
+ GError *error = NULL;
GPid pid;
if (!view->save)
@@ -140,7 +143,9 @@ main (int argc,
stream = fdopen (fd, "wb");
view->save (instance, surface, stream, width, height);
fclose (stream);
+#ifdef G_OS_UNIX
waitpid (pid, NULL, 0);
+#endif
g_spawn_close_pid (pid);
}