RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/rpmio/ rpmgrep.c

From: Jeff Johnson <jbj@rpm5.org>
Date: Mon 11 Feb 2008 - 03:21:14 CET
Message-Id: <20080211022114.4573B348460@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: rpm                              Date:   11-Feb-2008 03:21:14
  Branch: HEAD                             Handle: 2008021102211300

  Modified files:
    rpm/rpmio               rpmgrep.c

  Log:
    - rpmgrep: use Fopen/Fclose (r.fpio, not yet r.ufdio).

  Summary:
    Revision    Changes     Path
    1.13        +6  -5      rpm/rpmio/rpmgrep.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmgrep.c
  ============================================================================
  $ cvs diff -u -r1.12 -r1.13 rpmgrep.c
  --- rpm/rpmio/rpmgrep.c	11 Feb 2008 01:55:10 -0000	1.12
  +++ rpm/rpmio/rpmgrep.c	11 Feb 2008 02:21:13 -0000	1.13
  @@ -532,7 +532,7 @@
    * will be in the middle third most of the time, so the bottom third is
    * available for "before" context printing.
    *
  - * @param  handle	the fopened FILE stream for a normal file
  + * @param  handle	the Fopen'd FILE stream for a normal file
    *			the gzFile pointer when reading is via libz
    *			the BZFILE pointer when reading is via libbz2
    * @param frtype	FR_PLAIN, FR_LIBZ, or FR_LIBBZ2
  @@ -1029,7 +1029,7 @@
       int frtype;
       int pathlen;
       void *handle;
  -    FILE *in = NULL;	/* Ensure initialized */
  +    FD_t infd = NULL;	/* Ensure initialized */
   
   #ifdef SUPPORT_LIBZ
       gzFile ingz = NULL;
  @@ -1135,8 +1135,8 @@
   PLAIN_FILE:
   #endif
       {
  -	in = fopen(pathname, "r");
  -	handle = (void *)in;
  +	infd = Fopen(pathname, "r.fpio");
  +	handle = (void *)fdGetFILE(infd);
   	frtype = FR_PLAIN;
       }
   
  @@ -1181,7 +1181,8 @@
       } else
   #endif
   
  -    fclose(in);	/* Normal file close */
  +    if (infd)
  +	Fclose(infd);	/* Normal file close */
   
       return rc;	/* Pass back the yield from pcregrep(). */
   }
  @@ .
Received on Mon Feb 11 03:21:14 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.