Run all files modified by pr45 through nxstyle.

This commit is contained in:
Gregory Nutt
2020-02-03 07:35:37 -06:00
parent 37135e5dfe
commit 724a34bd3b
4 changed files with 74 additions and 62 deletions

View File

@@ -178,6 +178,7 @@ static int nxterm_initialize(void)
printf("nxterm_initialize: nx_connect failed: %d\n", errno); printf("nxterm_initialize: nx_connect failed: %d\n", errno);
return ERROR; return ERROR;
} }
return OK; return OK;
} }
@@ -223,6 +224,7 @@ int main(int argc, FAR char *argv[])
int ret; int ret;
/* General Initialization *************************************************/ /* General Initialization *************************************************/
/* Reset all global data */ /* Reset all global data */
printf("nxterm_main: Started\n"); printf("nxterm_main: Started\n");
@@ -235,6 +237,7 @@ int main(int argc, FAR char *argv[])
#endif #endif
/* NSH Initialization *****************************************************/ /* NSH Initialization *****************************************************/
/* Initialize the NSH library */ /* Initialize the NSH library */
printf("nxterm_main: Initialize NSH\n"); printf("nxterm_main: Initialize NSH\n");
@@ -255,7 +258,9 @@ int main(int argc, FAR char *argv[])
fprintf(stderr, "ERROR: Failed to start TELNET daemon: %d\n", ret); fprintf(stderr, "ERROR: Failed to start TELNET daemon: %d\n", ret);
} }
#endif #endif
/* NX Initialization ******************************************************/ /* NX Initialization ******************************************************/
/* Initialize NX */ /* Initialize NX */
printf("nxterm_main: Initialize NX\n"); printf("nxterm_main: Initialize NX\n");
@@ -281,6 +286,7 @@ int main(int argc, FAR char *argv[])
} }
/* Window Configuration ***************************************************/ /* Window Configuration ***************************************************/
/* Create a window */ /* Create a window */
printf("nxterm_main: Create window\n"); printf("nxterm_main: Create window\n");
@@ -352,7 +358,8 @@ int main(int argc, FAR char *argv[])
sleep(2); sleep(2);
/* NxTerm Configuration ************************************************/ /* NxTerm Configuration ***************************************************/
/* Use the window to create an NX console */ /* Use the window to create an NX console */
g_nxterm_vars.wndo.wcolor[0] = CONFIG_EXAMPLES_NXTERM_WCOLOR; g_nxterm_vars.wndo.wcolor[0] = CONFIG_EXAMPLES_NXTERM_WCOLOR;
@@ -392,8 +399,10 @@ int main(int argc, FAR char *argv[])
} }
/* Start Console Task *****************************************************/ /* Start Console Task *****************************************************/
/* Now re-direct stdout and stderr so that they use the NX console driver. /* Now re-direct stdout and stderr so that they use the NX console driver.
* Note that stdin is retained (file descriptor 0, probably the serial console). * Note that stdin is retained (file descriptor 0, probably the serial
* console).
*/ */
printf("nxterm_main: Starting the console task\n"); printf("nxterm_main: Starting the console task\n");
@@ -431,6 +440,7 @@ errout_with_hwnd:
nxtk_closewindow(g_nxterm_vars.hwnd); nxtk_closewindow(g_nxterm_vars.hwnd);
errout_with_nx: errout_with_nx:
/* Disconnect from the server */ /* Disconnect from the server */
nx_disconnect(g_nxterm_vars.hnx); nx_disconnect(g_nxterm_vars.hnx);

View File

@@ -179,7 +179,8 @@ static int telnetd_daemon(int argc, FAR char *argv[])
/* Set socket to reuse address */ /* Set socket to reuse address */
optval = 1; optval = 1;
if (setsockopt(listensd, SOL_SOCKET, SO_REUSEADDR, (void*)&optval, sizeof(int)) < 0) if (setsockopt(listensd, SOL_SOCKET, SO_REUSEADDR,
(FAR void *)&optval, sizeof(int)) < 0)
{ {
nerr("ERROR: setsockopt SO_REUSEADDR failure: %d\n", errno); nerr("ERROR: setsockopt SO_REUSEADDR failure: %d\n", errno);
goto errout_with_socket; goto errout_with_socket;
@@ -237,7 +238,7 @@ static int telnetd_daemon(int argc, FAR char *argv[])
/* Begin accepting connections */ /* Begin accepting connections */
for (;;) for (; ; )
{ {
socklen_t accptlen; socklen_t accptlen;

View File

@@ -232,6 +232,7 @@ int main(int argc, FAR char *argv[])
{ {
return nsh_system(argc, argv); return nsh_system(argc, argv);
} }
else
#endif #endif
{ {
return nsh_task(); return nsh_task();