lib: export the exit handler interface

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Imre Deak 2013-05-22 17:40:46 +03:00 committed by Daniel Vetter
parent 4dec89aef7
commit bce7d8a061
2 changed files with 9 additions and 4 deletions

View File

@ -1022,7 +1022,6 @@ static struct {
bool installed;
} orig_sig[MAX_SIGNALS];
typedef void (*drmtest_exit_handler_t)(int sig);
static drmtest_exit_handler_t exit_handler_fn[MAX_EXIT_HANDLERS];
static int exit_handler_count;
static bool exit_handler_disabled;
@ -1101,7 +1100,7 @@ static void drmtest_sig_handler(int sig)
* The handler will be passed the signal number if called due to a signal, or
* 0 otherwise.
*/
static int drmtest_install_exit_handler(drmtest_exit_handler_t fn)
int drmtest_install_exit_handler(drmtest_exit_handler_t fn)
{
int i;
@ -1131,7 +1130,7 @@ err:
return -1;
}
static void drmtest_disable_exit_handler(void)
void drmtest_disable_exit_handler(void)
{
sigset_t set;
int i;
@ -1151,7 +1150,7 @@ static void drmtest_disable_exit_handler(void)
exit_handler_disabled = true;
}
static void drmtest_enable_exit_handler(void)
void drmtest_enable_exit_handler(void)
{
if (!exit_handler_disabled)
return;

View File

@ -132,4 +132,10 @@ inline static void _do_or_die(const char *function, int line, int ret)
#define do_or_die(x) _do_or_die(__FUNCTION__, __LINE__, x)
#define do_ioctl(fd, ptr, sz) do_or_die(drmIoctl((fd), (ptr), (sz)))
typedef void (*drmtest_exit_handler_t)(int sig);
int drmtest_install_exit_handler(drmtest_exit_handler_t fn);
void drmtest_enable_exit_handler(void);
void drmtest_disable_exit_handler(void);
int drmtest_set_vt_graphics_mode(void);