#include <config.h>
#include "sbuild-auth-conv-tty.h"
#include "sbuild-ctty.h"
#include "sbuild-log.h"
#include <iostream>
#include <signal.h>
#include <termios.h>
#include <unistd.h>
#include <boost/format.hpp>
Include dependency graph for sbuild-auth-conv-tty.cc:
Typedefs | |
typedef std::pair< auth_conv_tty::error_code, const char * > | emap |
Functions | |
void | reset_alarm (struct sigaction *orig_sa) |
Disable the alarm and signal handler. | |
void | alarm_handler (int ignore) |
Handle the SIGALRM signal. | |
bool | set_alarm (int delay, struct sigaction *orig_sa) |
Set the SIGALARM handler, and set the timeout to delay seconds. | |
Variables | |
emap | init_errors [] |
This is a list of the supported error codes. | |
volatile sig_atomic_t | timer_expired = false |
typedef std::pair<auth_conv_tty::error_code,const char *> emap [static] |
void @0::alarm_handler | ( | int | ignore | ) | [static] |
Handle the SIGALRM signal.
ignore | the signal number (unused). |
void @0::reset_alarm | ( | struct sigaction * | orig_sa | ) | [static] |
Disable the alarm and signal handler.
orig_sa | the signal handler to restore. |
bool @0::set_alarm | ( | int | delay, | |
struct sigaction * | orig_sa | |||
) | [static] |
Set the SIGALARM handler, and set the timeout to delay seconds.
The old signal handler is stored in orig_sa.
delay | the delay (in seconds) before SIGALRM is raised. | |
orig_sa | the location to store the original signal handler. |
emap init_errors[] [static] |
Initial value:
{ emap(auth_conv_tty::CTTY, N_("No controlling terminal")), emap(auth_conv_tty::TIMEOUT, N_("Timed out")), emap(auth_conv_tty::TIMEOUT_PENDING, N_("Time is running out...")), emap(auth_conv_tty::TERMIOS, N_("Failed to get terminal settings")), emap(auth_conv_tty::CONV_TYPE, N_("Unsupported conversation type '%1%'")) }
It's used to construct the real error codes map.
volatile sig_atomic_t timer_expired = false [static] |