[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: stdout?

From: Kevin Pilch-Bisson <kevin_at_pilch-bisson.net>
Date: 2001-01-26 15:55:39 CET

Okay, here is a patch, which just copies STDOUT_FILENO into a memory
address then passes the address of that memory. It seems to work for
me.

Modified: subversion/client/diff.c
Log: Changed to use a copy of STDOUT_FILENO, so that we can take the
address of it.

Revision Changes Path
1.1 +2 -1 subversion/client/diff.c

Index: diff.c
===================================================================
RCS file: /cvs/subversion/subversion/client/diff.c,v
retrieving revision 1.1
diff -u -p -r1.1 diff.c
--- diff.c 2001/01/26 14:21:06 1.1
+++ diff.c 2001/01/26 14:54:29
@@ -37,6 +37,7 @@ svn_cl__print_file_diff (svn_string_t *p
   svn_error_t *err;
   svn_string_t *pristine_copy_path;
   const char *args[5];
+ apr_os_file_t stdout_fileno = STDOUT_FILENO;
 
   apr_file_t *outhandle = NULL;
 
@@ -49,7 +50,7 @@ svn_cl__print_file_diff (svn_string_t *p
 
   /* Get an apr_file_t representing stdout, which is where we'll have
      the diff program print to. */
- status = apr_put_os_file (&outhandle, (apr_os_file_t *) STDOUT_FILENO, pool);
+ status = apr_put_os_file (&outhandle, &stdout_fileno, pool);
   if (status)
     return svn_error_create (status, 0, NULL, pool,
                              "error: can't open handle to stdout");

On Fri, Jan 26, 2001 at 09:40:50AM -0500, Kevin Pilch-Bisson wrote:
> On Fri, Jan 26, 2001 at 08:37:57AM -0600, Ben Collins-Sussman wrote:
> > Kevin Pilch-Bisson <kevin@pilch-bisson.net> writes:
> >
> > > Anyway try status = apr_put_os_file(&file, &STDOUT_FILENO, pool). My
> > > guess is that your segfault was because you casted an int to a pointer,
> > > and then the filedes assignment dereferenced that pointer.
> >
> > Uh, this won't compile. You can't place an `&' in front of int, can you?
> >
> > diff.c:52: invalid lvalue in unary `&'
> >
> > I can't find any reference to STDOUT_FILENO in apr, except in apr.hw,
> > which is a win32-specific file. What the heck is this thing? :)
> >
> > Well, I checked in `svn diff' now, so somebody feel free to make
> > client/diff.c work correctly. :)
> > ____________________________________________________________
> Well you can place an & in from for an int, but not in front of a
> literal, which is what STD_FILENO is since it is #defined. I'll take a
> look at it, and let you know what I find.
> --
> >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Kevin Pilch-Bisson
> kevin@pilch-bisson.net
> http://www.pilch-bisson.net
> PGP Public Key At http://pgp.pilch-bisson.net

-- 
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson
kevin@pilch-bisson.net
http://www.pilch-bisson.net
PGP Public Key At http://pgp.pilch-bisson.net

  • application/pgp-signature attachment: stored
Received on Sat Oct 21 14:36:20 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.