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

Re: svn commit: r25692 - trunk/subversion/svn

From: Karl Fogel <kfogel_at_red-bean.com>
Date: 2007-07-09 18:48:29 CEST

sussman@tigris.org writes:
> --- trunk/subversion/svn/util.c (original)
> +++ trunk/subversion/svn/util.c Mon Jul 9 08:21:51 2007
> @@ -74,68 +74,53 @@
> }
>
> [...]
>
> +svn_error_t *
> +svn_cl__edit_file_externally(const char *path,
> + const char *editor_cmd,
> + apr_hash_t *config,
> + apr_pool_t *pool)
> +{
> + const char *editor, *cmd;
> + int sys_err;
> +
> + SVN_ERR(find_editor_binary(&editor, editor_cmd, config));
> +
> + cmd = apr_psprintf(pool, "%s %s", editor, path);
> + sys_err = system(cmd);
> + if (sys_err != 0)
> + /* Extracting any meaning from sys_err is platform specific, so just
> + use the raw value. */
> + return svn_error_createf(SVN_ERR_EXTERNAL_PROGRAM, NULL,
> + _("system('%s') returned %d"), cmd, sys_err);
> +
> + return SVN_NO_ERROR;
> +}

Hmmm, don't we have an APR-y way of invoking external commands? I
realize the system() call was in the code before, I just wonder if
this isn't an opportunity to upgrade to something more portable. (I
guess the main advantage of an APR-y way would be that the error code
would be meaningful.)

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jul 9 18:48:03 2007

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.