diff options
author | Russell Bryant <russell@russellbryant.com> | 2011-05-05 22:44:52 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2011-05-05 22:44:52 +0000 |
commit | f0f5e237bf96ed5531b164935bbe8dca1c7b70ed (patch) | |
tree | 2b7d632f7f42d434363d7dee71d987562eb56ed9 /res/res_crypto.c | |
parent | c28e2d380c185b8cda44b468504bb8a6892714a6 (diff) |
Merged revisions 317474 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r317474 | russell | 2011-05-05 17:36:33 -0500 (Thu, 05 May 2011) | 2 lines
Fix more "set but unused" warnings.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317475 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_crypto.c')
-rw-r--r-- | res/res_crypto.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/res/res_crypto.c b/res/res_crypto.c index 4886b4f1a..e25b8a4d6 100644 --- a/res/res_crypto.c +++ b/res/res_crypto.c @@ -99,7 +99,8 @@ static int pw_cb(char *buf, int size, int rwflag, void *userdata) { struct ast_key *key = (struct ast_key *)userdata; char prompt[256]; - int res, tmp; + int tmp; + int res; if (key->infd < 0) { /* Note that we were at least called */ @@ -118,6 +119,9 @@ static int pw_cb(char *buf, int size, int rwflag, void *userdata) tmp = ast_hide_password(key->infd); memset(buf, 0, size); res = read(key->infd, buf, size); + if (res == -1) { + ast_log(LOG_WARNING, "read() failed: %s\n", strerror(errno)); + } ast_restore_tty(key->infd, tmp); if (buf[strlen(buf) -1] == '\n') { buf[strlen(buf) - 1] = '\0'; |