diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-08-05 16:22:51 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-08-05 16:22:51 +0000 |
commit | cf46733632c7279a9fd0fe6ce26f9185a4ae82a9 (patch) | |
tree | da27775a2161723ef342e91af41a8b51fedef405 /subversion/libsvn_subr/prompt.c | |
parent | bb0ef45f7c46b0ae221b26265ef98a768c33f820 (diff) | |
download | subversion-tarball-master.tar.gz |
subversion-1.9.7HEADsubversion-1.9.7master
Diffstat (limited to 'subversion/libsvn_subr/prompt.c')
-rw-r--r-- | subversion/libsvn_subr/prompt.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/subversion/libsvn_subr/prompt.c b/subversion/libsvn_subr/prompt.c index d0c29d0..8f24b42 100644 --- a/subversion/libsvn_subr/prompt.c +++ b/subversion/libsvn_subr/prompt.c @@ -177,7 +177,7 @@ terminal_open(terminal_handle_t **terminal, svn_boolean_t noecho, and stderr for prompting. */ apr_file_t *tmpfd; status = apr_file_open(&tmpfd, "/dev/tty", - APR_READ | APR_WRITE, + APR_FOPEN_READ | APR_FOPEN_WRITE, APR_OS_DEFAULT, pool); *terminal = apr_palloc(pool, sizeof(terminal_handle_t)); if (!status) @@ -236,7 +236,6 @@ terminal_puts(const char *string, terminal_handle_t *terminal, apr_pool_t *pool) { svn_error_t *err; - apr_status_t status; const char *converted; err = svn_cmdline_cstring_from_utf8(&converted, string, pool); @@ -255,13 +254,10 @@ terminal_puts(const char *string, terminal_handle_t *terminal, } #endif - status = apr_file_write_full(terminal->outfd, converted, - strlen(converted), NULL); - if (!status) - status = apr_file_flush(terminal->outfd); - if (status) - return svn_error_wrap_apr(status, _("Can't write to terminal")); - return SVN_NO_ERROR; + SVN_ERR(svn_io_file_write_full(terminal->outfd, converted, + strlen(converted), NULL, pool)); + + return svn_error_trace(svn_io_file_flush(terminal->outfd, pool)); } /* These codes can be returned from terminal_getc instead of a character. */ @@ -835,9 +831,8 @@ plaintext_prompt_helper(svn_boolean_t *may_save_plaintext, { if (err->apr_err == SVN_ERR_CANCELLED) { - svn_error_clear(err); *may_save_plaintext = FALSE; - return SVN_NO_ERROR; + return err; } else return err; |