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

svn system() replacement ?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: 2002-01-28 09:59:38 CET

The editor-code for commit does this right now:

 [psedo code]

 sprintf(buffer, "%s %s", editor, file)
 system(buffer)

But, as reviewers pointed out, the svn_io_run_cmd() might be a better option.

Now, while working my promised cleanup of my previous patch I've modified the
above to this approach:

  /* run the editor command line */
  cmdargs[0] = editor;
  cmdargs[1] = fullfile;
  cmdargs[2] = NULL;

  error = svn_io_run_cmd (".",
                          editor,
                          cmdargs,
                          &exitcode,
                          &exitwhy,
                          NULL, /* infile */
                          NULL, /* outfile */
                          NULL, /* errfile */
                          pool);

... which unfortunately, doesn't work.

After the function has run, the variables above say:

(gdb) p exitcode
$1 = 255
(gdb) p exitwhy
$2 = APR_PROC_EXIT
(gdb) p error
$3 = (svn_error_t *) 0x0

Can anyone tellme what I'm doing wrong or what am I missing?

-- 
      Daniel Stenberg - http://daniel.haxx.se - +46-705-44 31 77
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:00 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.