MCPcopy Create free account
hub / github.com/ElementsProject/lightning / disable_echo

Function disable_echo

common/hsm_secret.c:383–398  ·  view source on GitHub ↗

Disable terminal echo if needed */

Source from the content-addressed store, hash-verified

381
382/* Disable terminal echo if needed */
383static bool disable_echo(struct termios *saved_term)
384{
385 if (!isatty(fileno(stdin)))
386 return false;
387
388 if (tcgetattr(fileno(stdin), saved_term) != 0)
389 return false;
390
391 struct termios tmp = *saved_term;
392 tmp.c_lflag &= ~ECHO;
393
394 if (tcsetattr(fileno(stdin), TCSANOW, &tmp) != 0)
395 return false;
396
397 return true;
398}
399
400/* Restore terminal echo if it was disabled */
401static void restore_echo(const struct termios *saved_term)

Callers 1

read_stdin_passFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected