OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   31-Mar-2004 16:58:16
  Branch: HEAD                             Handle: 2004033115581500

  Modified files:
    openpkg-src/flex        flex.patch flex.spec

  Log:
    cleanup stdio fiddling patch

  Summary:
    Revision    Changes     Path
    1.10        +38 -35     openpkg-src/flex/flex.patch
    1.70        +3  -7      openpkg-src/flex/flex.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/flex/flex.patch
  ============================================================================
  $ cvs diff -u -r1.9 -r1.10 flex.patch
  --- openpkg-src/flex/flex.patch       19 Mar 2004 14:15:37 -0000      1.9
  +++ openpkg-src/flex/flex.patch       31 Mar 2004 14:58:15 -0000      1.10
  @@ -1,38 +1,3 @@
  -Index: filter.c
  ---- filter.c.orig    2003-03-25 17:39:08.000000000 +0100
  -+++ filter.c 2004-03-19 14:43:31.317172000 +0100
  -@@ -158,10 +158,13 @@
  -                     int     r;
  - 
  -                     /* setup streams again */
  -+#ifdef NOTOUCHSTDIO
  --                    if ((stdin = fdopen (0, "r")) == NULL)
  --                            flexfatal (_("fdopen(0) failed"));
  --                    if ((stdout = fdopen (1, "w")) == NULL)
  --                            flexfatal (_("fdopen(1) failed"));
  -+#else
  -+                    if ((freopen ("/dev/stdin", "r", stdin)) == NULL)
  -+                            flexfatal (_("freopen(stdin) failed"));
  -+                    if ((freopen ("/dev/stdout", "w", stdout)) == NULL)
  -+                            flexfatal (_("freopen(stdout) failed"));
  -+#endif
  - 
  -                     if ((r = chain->filter_func (chain)) == -1)
  -                             flexfatal (_("filter_func failed"));
  -@@ -181,8 +188,11 @@
  -     if (dup2 (pipes[1], 1) == -1)
  -             flexfatal (_("dup2(pipes[1],1)"));
  -     close (pipes[1]);
  -+#ifdef NOTOUCHSTDIO
  --    if ((stdout = fdopen (1, "w")) == NULL)
  --            flexfatal (_("fdopen(1) failed"));
  -+#else
  -+    if ((freopen ("/dev/stdout", "w", stdout)) == NULL)
  -+            flexfatal (_("freopen(stdout) failed"));
  -+#endif
  - 
  -     return true;
  - }
   Index: flex.skl
   --- flex.skl.orig    2003-04-01 03:51:38.000000000 +0200
   +++ flex.skl 2004-02-07 13:21:59.000000000 +0100
  @@ -360,3 +325,41 @@
    case YY_STATE_EOF(INITIAL):
    case YY_STATE_EOF(SECT2):
    case YY_STATE_EOF(CODEBLOCK):
  +Index: filter.c
  +--- filter.c.orig    2003-03-25 17:39:08.000000000 +0100
  ++++ filter.c 2004-03-31 16:55:21.000000000 +0200
  +@@ -158,10 +158,21 @@
  +                     int     r;
  + 
  +                     /* setup streams again */
  ++#if 0
  +                     if ((stdin = fdopen (0, "r")) == NULL)
  +                             flexfatal (_("fdopen(0) failed"));
  +                     if ((stdout = fdopen (1, "w")) == NULL)
  +                             flexfatal (_("fdopen(1) failed"));
  ++#else
  ++                    /* the above is theoretically correct, but on some
  ++                       platforms (FreeBSD, Solaris, etc) not possible because
  ++                       stdin/stdout/stderr are read-only. Unfortunately there is no
  ++                       standardized alternative except the cheating solution: in 
most
  ++                       Unix stdio(3) implementations a FILE is nothing more than a 
C
  ++                       structure referencing a Unix filedescriptor. Hence one can 
just
  ++                       do nothing as long as the underlying filedescriptor was 
already
  ++                       changed. */
  ++#endif
  + 
  +                     if ((r = chain->filter_func (chain)) == -1)
  +                             flexfatal (_("filter_func failed"));
  +@@ -181,8 +192,12 @@
  +     if (dup2 (pipes[1], 1) == -1)
  +             flexfatal (_("dup2(pipes[1],1)"));
  +     close (pipes[1]);
  ++#if 0
  +     if ((stdout = fdopen (1, "w")) == NULL)
  +             flexfatal (_("fdopen(1) failed"));
  ++#else
  ++    /* do just nothing (reason: see above) */
  ++#endif
  + 
  +     return true;
  + }
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/flex/flex.spec
  ============================================================================
  $ cvs diff -u -r1.69 -r1.70 flex.spec
  --- openpkg-src/flex/flex.spec        19 Mar 2004 14:15:37 -0000      1.69
  +++ openpkg-src/flex/flex.spec        31 Mar 2004 14:58:15 -0000      1.70
  @@ -39,7 +39,7 @@
   Group:        Language
   License:      BSD
   Version:      %{V_release}
  -Release:      20040319
  +Release:      20040331
   
   #   package options
   %option       with_beta  yes
  @@ -88,14 +88,10 @@
   %endif
   
   %build
  -    CFLAGS="%{l_cflags -O}"
  -    case "%{l_platform -t}" in
  -       *-sunos*    ) CFLAGS="$CFLAGS -DNOTOUCHSTDIO" ;;
  -    esac
       #   configure and build Flex (stable version)
       ( cd flex-%{V_release_maj}
         CC="%{l_cc}" \
  -      CFLAGS="$CFLAGS" \
  +      CFLAGS="%{l_cflags -O}" \
         ./configure \
             --prefix=$RPM_BUILD_ROOT%{l_prefix}
         %{l_make} %{l_mflags}
  @@ -105,7 +101,7 @@
   %if "%{with_beta}" == "yes"
       ( cd flex-%{V_beta}
         CC="%{l_cc}" \
  -      CFLAGS="$CFLAGS" \
  +      CFLAGS="%{l_cflags -O}" \
         HELP2MAN=`type -P true` \
         ./configure \
             --prefix=%{l_prefix} \
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to