From 7853748e44b8c4f24573b9e97e9ab21c8ee2a0d1 Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 17 Nov 2016 04:14:47 -0500 Subject: set tty affiliation in the driver, effective for both the library and utility. --- src/driver/ptyc_driver_ctx.c | 7 +++++++ src/ptycon.c | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/driver/ptyc_driver_ctx.c b/src/driver/ptyc_driver_ctx.c index 20425b7..bda581b 100644 --- a/src/driver/ptyc_driver_ctx.c +++ b/src/driver/ptyc_driver_ctx.c @@ -22,6 +22,11 @@ #include "ptycon_driver_impl.h" #include "argv/argv.h" +/* pty integration */ +static const nt_tty_affiliation tty_affiliation + __attr_section__(".midipix") + = NT_TTY_AFFILIATION_DEFAULT; + /* ntapi accessor table */ const ntapi_vtbl * ptyc_ntapi; @@ -63,6 +68,8 @@ static int32_t ptyc_vtbl_init(void) int32_t status; nt_timeout timeout; + (void)tty_affiliation; + switch (at_locked_cas_32(&ptyc_once,0,1)) { case 0: if ((status = ntcon_vtbl_init(&ptyc_ntcon_vtbl))) { diff --git a/src/ptycon.c b/src/ptycon.c index 1999494..8f5bd52 100644 --- a/src/ptycon.c +++ b/src/ptycon.c @@ -12,10 +12,6 @@ static const nt_guid ptycon_daemon_guid = PTYC_PORT_GUID_DAEMON; -static const nt_tty_affiliation tty_affiliation - __attr_section__(".midipix") - = NT_TTY_AFFILIATION_DEFAULT; - static void ptycon_exit(int code) { /* posix exit code? */ @@ -135,7 +131,6 @@ static int __stdcall ptycon_daemon_entry_point(void * arg) char ** envp; (void)arg; - (void)tty_affiliation; if ((status = ntapi->tt_get_argv_envp_utf8( &argc,&argv,&envp, -- cgit v1.2.3