Cygwin: pty: Correct typos that do not fit the coding style.

This commit is contained in:
Takashi Yano 2019-09-15 13:36:23 +09:00 committed by Ken Brown
parent 244f03627d
commit fac5a01aec
1 changed files with 13 additions and 13 deletions

View File

@ -45,7 +45,7 @@ details. */
#endif /* ENABLE_VIRTUAL_TERMINAL_INPUT */ #endif /* ENABLE_VIRTUAL_TERMINAL_INPUT */
extern "C" int sscanf (const char *, const char *, ...); extern "C" int sscanf (const char *, const char *, ...);
extern "C" int ttyname_r(int, char*, size_t); extern "C" int ttyname_r (int, char*, size_t);
#define close_maybe(h) \ #define close_maybe(h) \
do { \ do { \
@ -2147,7 +2147,7 @@ fhandler_pty_master::close ()
else if (obi.HandleCount == (getPseudoConsole () ? 2 : 1)) else if (obi.HandleCount == (getPseudoConsole () ? 2 : 1))
/* Helper process has inherited one. */ /* Helper process has inherited one. */
{ {
termios_printf("Closing last master of pty%d", get_minor ()); termios_printf ("Closing last master of pty%d", get_minor ());
/* Close Pseudo Console */ /* Close Pseudo Console */
if (getPseudoConsole ()) if (getPseudoConsole ())
{ {
@ -2446,9 +2446,9 @@ get_locale_from_env (char *locale)
char lang[ENCODING_LEN + 1] = {0, }, country[ENCODING_LEN + 1] = {0, }; char lang[ENCODING_LEN + 1] = {0, }, country[ENCODING_LEN + 1] = {0, };
env = getenv ("LC_ALL"); env = getenv ("LC_ALL");
if (env == NULL || !*env) if (env == NULL || !*env)
env = getenv("LC_CTYPE"); env = getenv ("LC_CTYPE");
if (env == NULL || !*env) if (env == NULL || !*env)
env = getenv("LANG"); env = getenv ("LANG");
if (env == NULL || !*env) if (env == NULL || !*env)
{ {
if (GetLocaleInfo (LOCALE_CUSTOM_UI_DEFAULT, if (GetLocaleInfo (LOCALE_CUSTOM_UI_DEFAULT,
@ -2476,7 +2476,7 @@ get_locale_from_env (char *locale)
LOCALE_SISO3166CTRYNAME, LOCALE_SISO3166CTRYNAME,
country, sizeof (country)); country, sizeof (country));
if (strlen (lang) && strlen (country)) if (strlen (lang) && strlen (country))
__small_sprintf (lang + strlen(lang), "_%s.UTF-8", country); __small_sprintf (lang + strlen (lang), "_%s.UTF-8", country);
else else
strcpy (lang , "C.UTF-8"); strcpy (lang , "C.UTF-8");
env = lang; env = lang;
@ -2492,7 +2492,7 @@ get_langinfo (char *locale_out, char *charset_out)
get_locale_from_env (new_locale); get_locale_from_env (new_locale);
__locale_t loc; __locale_t loc;
memset(&loc, 0, sizeof (loc)); memset (&loc, 0, sizeof (loc));
const char *locale = __loadlocale (&loc, LC_CTYPE, new_locale); const char *locale = __loadlocale (&loc, LC_CTYPE, new_locale);
if (!locale) if (!locale)
locale = "C"; locale = "C";
@ -2565,8 +2565,8 @@ get_langinfo (char *locale_out, char *charset_out)
return 0; return 0;
/* Set results */ /* Set results */
strcpy(locale_out, new_locale); strcpy (locale_out, new_locale);
strcpy(charset_out, charset); strcpy (charset_out, charset);
return lcid; return lcid;
} }
@ -2670,7 +2670,7 @@ fhandler_pty_slave::fixup_after_attach (bool native_maybe, int fd_set)
get_ttyp ()->pcon_pid = myself->pid; get_ttyp ()->pcon_pid = myself->pid;
get_ttyp ()->switch_to_pcon_out = true; get_ttyp ()->switch_to_pcon_out = true;
} }
init_console_handler(false); init_console_handler (false);
} }
else if (fd == 0 && native_maybe) else if (fd == 0 && native_maybe)
/* Read from unattached pseudo console cause freeze, /* Read from unattached pseudo console cause freeze,
@ -2754,7 +2754,7 @@ fhandler_pty_slave::fixup_after_exec ()
{ \ { \
void *api = hook_api (module, #name, (void *) name##_Hooked); \ void *api = hook_api (module, #name, (void *) name##_Hooked); \
name##_Orig = (__typeof__ (name) *) api; \ name##_Orig = (__typeof__ (name) *) api; \
/*if (api) system_printf(#name " hooked.");*/ \ /*if (api) system_printf (#name " hooked.");*/ \
} }
DO_HOOK (NULL, WriteFile); DO_HOOK (NULL, WriteFile);
DO_HOOK (NULL, WriteConsoleA); DO_HOOK (NULL, WriteConsoleA);
@ -3118,7 +3118,7 @@ fhandler_pty_master::setup_pseudoconsole ()
if (res != S_OK) if (res != S_OK)
{ {
system_printf ("CreatePseudoConsole() failed. %08x\n", system_printf ("CreatePseudoConsole() failed. %08x\n",
GetLastError()); GetLastError ());
CloseHandle (from_master); CloseHandle (from_master);
CloseHandle (to_slave); CloseHandle (to_slave);
from_master = from_master_cyg; from_master = from_master_cyg;
@ -3230,7 +3230,7 @@ fhandler_pty_master::setup ()
termios_printf ("can't set output_handle(%p) to non-blocking mode", termios_printf ("can't set output_handle(%p) to non-blocking mode",
get_output_handle ()); get_output_handle ());
char pipename[sizeof("ptyNNNN-to-master-cyg")]; char pipename[sizeof ("ptyNNNN-to-master-cyg")];
__small_sprintf (pipename, "pty%d-to-master", unit); __small_sprintf (pipename, "pty%d-to-master", unit);
res = fhandler_pipe::create (&sec_none, &from_slave, &to_master, res = fhandler_pipe::create (&sec_none, &from_slave, &to_master,
fhandler_pty_common::pipesize, pipename, 0); fhandler_pty_common::pipesize, pipename, 0);
@ -3406,7 +3406,7 @@ fhandler_pty_common::process_opost_output (HANDLE h, const void *ptr, ssize_t& l
break; break;
else else
{ {
set_errno(EAGAIN); set_errno (EAGAIN);
len = -1; len = -1;
return TRUE; return TRUE;
} }