Date: Sat, 17 May 2003 15:18:17 +0200 From: Erik Trulsson <ertr1013@student.uu.se> To: Jonathan Belson <jon@witchspace.com>, Kris Kennaway <kris@obsecurity.org>, ports@FreeBSD.org Subject: Re: FreeBSD Port: pornview-0.2.0.p.1 Message-ID: <20030517131817.GA69768@falcon.midgard.homeip.net> In-Reply-To: <20030517130549.GA44928@falcon.midgard.homeip.net> References: <3EC53C6C.1040904@witchspace.com> <20030517121908.GA67369@rot13.obsecurity.org> <3EC62CC2.6090209@witchspace.com> <20030517130549.GA44928@falcon.midgard.homeip.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, May 17, 2003 at 03:05:49PM +0200, Erik Trulsson wrote: > On Sat, May 17, 2003 at 01:36:18PM +0100, Jonathan Belson wrote: > > Kris Kennaway wrote: > > >The package builds currently fail on 4.x: > > > > > >http://bento.freebsd.org/errorlogs/i386-4-latest/pornview-0.2.0.p.1_1.log > > > > > >Your workaround does not sound like a solution though. stdin et al > > >are defined for a reason ;-) > > > > The problem is in the following structure: > > > > struct ChildContext_Tag > > { > > ...blah... > > int stdout_fd; > > int stderr_fd; > > int stdin_fd; > > That part of the structure is not the problem. The next part of this > structure is the problem. > > gchar stdout[GTK_MPLAYER_BUF_SIZE]; > gint stdout_size; > gchar stderr[GTK_MPLAYER_BUF_SIZE]; > gint stderr_size; > > This code is faulty since stdin/stdout/stderr *are* macros and > therefore *will* mess up this declaration. > > > ...blah... > > }; > > > > The author's (perfectly legitimate) members are being mangled by > > Not legitimate. The C standard itself says that stdin/stdout/stderr are > supposed to be macros and therefore this behaviour is expected. > > > the preprocessor. It seems a little unfair to ask the author to > > change them, the only other alternative I can see is to s/// every > > The bug is in the application, not in FreeBSD, so, unfair or not, it > isn't FreeBSD that should be changed. > > > reference to something that doesn't clash with the FreeBSD stdio.h. > > > > Ugly :-( And until the author of pornview fixes his code the attached patch for the port should fix things. -- <Insert your favourite quote here.> Erik Trulsson ertr1013@student.uu.se --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=patch Index: files/patch-src::support::widgets::gtkmplayer.c =================================================================== RCS file: /ncvs/ports/graphics/pornview/files/patch-src::support::widgets::gtkmplayer.c,v retrieving revision 1.1 diff -u -r1.1 patch-src::support::widgets::gtkmplayer.c --- files/patch-src::support::widgets::gtkmplayer.c 5 Apr 2003 17:30:51 -0000 1.1 +++ files/patch-src::support::widgets::gtkmplayer.c 17 May 2003 13:10:56 -0000 @@ -1,5 +1,5 @@ ---- src/support/widgets/gtkmplayer.c.orig Sat Apr 5 18:54:40 2003 -+++ src/support/widgets/gtkmplayer.c Sat Apr 5 18:55:27 2003 +--- src/support/widgets/gtkmplayer.c.orig Fri Dec 13 12:15:21 2002 ++++ src/support/widgets/gtkmplayer.c Sat May 17 15:04:45 2003 @@ -30,6 +30,7 @@ #include <errno.h> #include <ctype.h> @@ -8,3 +8,67 @@ #include <gtk/gtk.h> #include <gdk/gdkx.h> +@@ -72,9 +73,9 @@ + int stderr_fd; + int stdin_fd; + +- gchar stdout[GTK_MPLAYER_BUF_SIZE]; ++ gchar stdoutb[GTK_MPLAYER_BUF_SIZE]; + gint stdout_size; +- gchar stderr[GTK_MPLAYER_BUF_SIZE]; ++ gchar stderrb[GTK_MPLAYER_BUF_SIZE]; + gint stderr_size; + + ProcessLineFunc process_line_fn; +@@ -1049,13 +1050,13 @@ + context->stdout_fd = out_fd[0]; + fcntl (context->stdout_fd, F_SETFL, O_NONBLOCK); + close (out_fd[1]); +- context->stdout[0] = '\0'; ++ context->stdoutb[0] = '\0'; + context->stdout_size = 0; + + context->stderr_fd = err_fd[0]; + fcntl (context->stderr_fd, F_SETFL, O_NONBLOCK); + close (err_fd[1]); +- context->stderr[0] = '\0'; ++ context->stderrb[0] = '\0'; + context->stderr_size = 0; + + context->stdin_fd = in_fd[1]; +@@ -1193,7 +1194,7 @@ + + if (size > 0 && size < GTK_MPLAYER_BUF_SIZE) + { +- memcpy (buf, context->stderr, size); ++ memcpy (buf, context->stderrb, size); + next = buf + size; + } + else +@@ -1211,7 +1212,7 @@ + size += MIN (GTK_MPLAYER_BUF_SIZE - 1, n); + + process_lines (context, buf, size, +- context->stderr, &context->stderr_size, TRUE); ++ context->stderrb, &context->stderr_size, TRUE); + } + + /* +@@ -1221,7 +1222,7 @@ + + if (size > 0 && size < GTK_MPLAYER_BUF_SIZE) + { +- memcpy (buf, context->stdout, size); ++ memcpy (buf, context->stdoutb, size); + next = buf + size; + } + else +@@ -1240,7 +1241,7 @@ + pos = context->player->pos; + + process_lines (context, buf, size, +- context->stdout, &context->stdout_size, FALSE); ++ context->stdoutb, &context->stdout_size, FALSE); + + if (fabs (context->player->pos - pos) > 0.1) + gtk_signal_emit (GTK_OBJECT (context->player), --MGYHOYXEY6WxJCY8--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030517131817.GA69768>