From 6f456aa1816e063ee261f1b444906021d8bbb45b Mon Sep 17 00:00:00 2001 From: Frank Ueberschar Date: Tue, 30 Oct 2018 11:27:48 +0100 Subject: [PATCH] console: changed argument name from stdin to std_in to avoid name conflicts - part of pullrequest #123 by peter-kutak --- core/src/console/auth_pam.cc | 14 +++++++------- core/src/console/auth_pam.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/src/console/auth_pam.cc b/core/src/console/auth_pam.cc index 413876edd7c..b309e3ab7b2 100644 --- a/core/src/console/auth_pam.cc +++ b/core/src/console/auth_pam.cc @@ -40,10 +40,10 @@ enum class PamAuthState { }; static PamAuthState state = PamAuthState::INIT; -static bool SetEcho(FILE *stdin, bool on); +static bool SetEcho(FILE *std_in, bool on); -bool ConsolePamAuthenticate(FILE *stdin, BareosSocket *UA_sock) +bool ConsolePamAuthenticate(FILE *std_in, BareosSocket *UA_sock) { bool quit = false; bool error = false; @@ -70,7 +70,7 @@ bool ConsolePamAuthenticate(FILE *stdin, BareosSocket *UA_sock) switch (type) { case PAM_PROMPT_ECHO_OFF: case PAM_PROMPT_ECHO_ON: - SetEcho (stdin, type == PAM_PROMPT_ECHO_ON); + SetEcho (std_in, type == PAM_PROMPT_ECHO_ON); state = PamAuthState::RECEIVE_MSG; break; case PAM_SUCCESS: @@ -123,19 +123,19 @@ bool ConsolePamAuthenticate(FILE *stdin, BareosSocket *UA_sock) } }; /* while (!quit) */ - SetEcho (stdin, true); + SetEcho (std_in, true); ConsoleOutput("\n"); return !error; } #include -static bool SetEcho(FILE *stdin, bool on) +static bool SetEcho(FILE *std_in, bool on) { struct termios termios_old, termios_new; /* Turn echoing off and fail if we can’t. */ - if (tcgetattr (fileno (stdin), &termios_old) != 0) + if (tcgetattr (fileno (std_in), &termios_old) != 0) return false; termios_new = termios_old; if (on) { @@ -143,7 +143,7 @@ static bool SetEcho(FILE *stdin, bool on) } else { termios_new.c_lflag &= ~ECHO; } - if (tcsetattr (fileno (stdin), TCSAFLUSH, &termios_new) != 0) + if (tcsetattr (fileno (std_in), TCSAFLUSH, &termios_new) != 0) return false; return true; } diff --git a/core/src/console/auth_pam.h b/core/src/console/auth_pam.h index 783168cdaa3..2ab4d551bbc 100644 --- a/core/src/console/auth_pam.h +++ b/core/src/console/auth_pam.h @@ -27,7 +27,7 @@ class BareosSocket; -bool ConsolePamAuthenticate(FILE *stdin, BareosSocket *UA_sock); +bool ConsolePamAuthenticate(FILE *std_in, BareosSocket *UA_sock); #endif /* BAREOS_CONSOLE_AUTH_PAM_H_ */