[PATCH 9/9] telnetd: Use syslog() instead of printk()

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Apr 30 09:48:17 UTC 2018


Update #3419.
---
 cpukit/telnetd/pty.c          | 10 ++++++++--
 cpukit/telnetd/telnetd-init.c |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/cpukit/telnetd/pty.c b/cpukit/telnetd/pty.c
index d41de97d85..14d688018f 100644
--- a/cpukit/telnetd/pty.c
+++ b/cpukit/telnetd/pty.c
@@ -42,6 +42,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <syslog.h>
 #include <unistd.h>
 /*-----------------------------------------*/
 #define IAC_ESC    255
@@ -453,8 +454,13 @@ rtems_device_driver my_pty_initialize(
     chmod(telnet_ptys[ndx].devname,0660);
     chown(telnet_ptys[ndx].devname,2,0); /* tty,root*/
   };
-  printk("Device: /dev/pty%X../dev/pty%X (%d)pseudo-terminals registered.\n",
-          0,rtems_telnetd_maximum_ptys-1,rtems_telnetd_maximum_ptys);
+  syslog(
+    LOG_KERN | LOG_INFO,
+    "/dev/pty%X../dev/pty%X (%d) pseudo-terminals registered.\n",
+    0,
+    rtems_telnetd_maximum_ptys - 1,
+    rtems_telnetd_maximum_ptys
+  );
 
   return RTEMS_SUCCESSFUL;
 }
diff --git a/cpukit/telnetd/telnetd-init.c b/cpukit/telnetd/telnetd-init.c
index 760db41fcc..7762ad70ba 100644
--- a/cpukit/telnetd/telnetd-init.c
+++ b/cpukit/telnetd/telnetd-init.c
@@ -12,7 +12,7 @@
 
 #include <rtems/telnetd.h>
 
-int rtems_initialize_telnetd( void )
+rtems_status_code rtems_telnetd_initialize( void )
 {
   return rtems_telnetd_start( &rtems_telnetd_config );
 }
-- 
2.12.3




More information about the devel mailing list