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

Joel Sherrill joel at rtems.org
Mon Apr 30 22:12:22 UTC 2018


Sorry to ask this but is there a syslog service that needs to be started
before
telnetd? Is there some dependency?

What's the rationale for this change?

On Mon, Apr 30, 2018 at 4:48 AM, Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> 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
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20180430/6f24c4e4/attachment-0002.html>


More information about the devel mailing list