summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2010-01-20 10:58:29 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-01-20 10:58:29 +0000
commitf3d579362c6bce8dcf8b23650e0b70490045970b (patch)
treef47b62ceb2538579705aedf777ad93b0e7b6c05a
parent89676040530f5336ff157598870bfaff0d7d4aad (diff)
pluginloader: fix compiler warning on win32
Move variable that's only used on unix into the unix block so that the compiler doesn't complain about the unused variable on win32 (see #597662).
-rw-r--r--gst/gstpluginloader.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/gst/gstpluginloader.c b/gst/gstpluginloader.c
index 3b87736c80..fb18f62ab7 100644
--- a/gst/gstpluginloader.c
+++ b/gst/gstpluginloader.c
@@ -435,7 +435,6 @@ gboolean
_gst_plugin_loader_client_run ()
{
GstPluginLoader *l;
- int dup_fd = 0;
l = plugin_loader_new (NULL);
if (l == NULL)
@@ -445,25 +444,29 @@ _gst_plugin_loader_client_run ()
* Dup those somewhere better so that plugins printing things
* won't interfere with anything */
#ifndef G_OS_WIN32
- dup_fd = dup (0); /* STDIN */
- if (dup_fd == -1) {
- GST_ERROR ("Failed to start. Could no dup STDIN, errno %d", errno);
- return FALSE;
- }
- l->fd_r.fd = dup_fd;
- close (0);
+ {
+ int dup_fd;
- dup_fd = dup (1); /* STDOUT */
- if (dup_fd == -1) {
- GST_ERROR ("Failed to start. Could no dup STDOUT, errno %d", errno);
- return FALSE;
- }
- l->fd_w.fd = dup_fd;
- close (1);
+ dup_fd = dup (0); /* STDIN */
+ if (dup_fd == -1) {
+ GST_ERROR ("Failed to start. Could no dup STDIN, errno %d", errno);
+ return FALSE;
+ }
+ l->fd_r.fd = dup_fd;
+ close (0);
- /* Dup stderr down to stdout so things that plugins print are visible,
- * but don't care if it fails */
- dup2 (2, 1);
+ dup_fd = dup (1); /* STDOUT */
+ if (dup_fd == -1) {
+ GST_ERROR ("Failed to start. Could no dup STDOUT, errno %d", errno);
+ return FALSE;
+ }
+ l->fd_w.fd = dup_fd;
+ close (1);
+
+ /* Dup stderr down to stdout so things that plugins print are visible,
+ * but don't care if it fails */
+ dup2 (2, 1);
+ }
#else
/* FIXME: Use DuplicateHandle and friends on win32 */
l->fd_w.fd = 1; /* STDOUT */