diff --git a/drivers/syslog/Make.defs b/drivers/syslog/Make.defs index 22e1e9738a..96e5d7d794 100644 --- a/drivers/syslog/Make.defs +++ b/drivers/syslog/Make.defs @@ -21,7 +21,7 @@ ############################################################################ # Include SYSLOG Infrastructure -CSRCS += vsyslog.c syslog_stream.c syslog_emergstream.c syslog_channel.c +CSRCS += vsyslog.c syslog_stream.c syslog_channel.c CSRCS += syslog_putc.c syslog_write.c syslog_force.c syslog_flush.c ifeq ($(CONFIG_SYSLOG_INTBUFFER),y) diff --git a/drivers/syslog/syslog_emergstream.c b/drivers/syslog/syslog_emergstream.c deleted file mode 100644 index ae8a2e74ed..0000000000 --- a/drivers/syslog/syslog_emergstream.c +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** - * drivers/syslog/syslog_emergstream.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include "syslog.h" - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: emergstream_putc - ****************************************************************************/ - -static void emergstream_putc(FAR struct lib_outstream_s *this, int ch) -{ - int ret; - - /* Try writing until the write was successful or until an irrecoverable - * error occurs. - */ - - do - { - /* Write the character to the supported logging device. On failure, - * syslog_force returns a negated errno value. - */ - - ret = syslog_force(ch); - if (ret >= 0) - { - this->nput++; - return; - } - - /* The special return value -EINTR means that syslog_force() was - * awakened by a signal. This is not a real error and must be - * ignored in this context. - */ - } - while (ret == -EINTR); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: emergstream - * - * Description: - * Initializes a stream for use with the configured emergency syslog - * interface. Only accessible from with the OS SYSLOG logic. - * - * Input Parameters: - * stream - User allocated, uninitialized instance of struct - * lib_outstream_s to be initialized. - * - * Returned Value: - * None (User allocated instance initialized). - * - ****************************************************************************/ - -void emergstream(FAR struct lib_outstream_s *stream) -{ - stream->put = emergstream_putc; - stream->flush = lib_noflush; - stream->nput = 0; -} diff --git a/drivers/syslog/vsyslog.c b/drivers/syslog/vsyslog.c index 80c65b120d..65243d4c1c 100644 --- a/drivers/syslog/vsyslog.c +++ b/drivers/syslog/vsyslog.c @@ -116,22 +116,10 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap) #endif /* Wrap the low-level output in a stream object and let lib_vsprintf - * do the work. NOTE that emergency priority output is handled - * differently.. it will use the SYSLOG emergency stream. + * do the work. */ - if (priority == LOG_EMERG) - { - /* Use the SYSLOG emergency stream */ - - emergstream(&stream.public); - } - else - { - /* Use the normal SYSLOG stream */ - - syslogstream_create(&stream); - } + syslogstream_create(&stream); #if defined(CONFIG_SYSLOG_TIMESTAMP) /* Prepend the message with the current time, if available */ diff --git a/include/nuttx/streams.h b/include/nuttx/streams.h index 0d179a7797..8b63e8cd4c 100644 --- a/include/nuttx/streams.h +++ b/include/nuttx/streams.h @@ -380,24 +380,6 @@ void syslogstream_destroy(FAR struct lib_syslogstream_s *stream); # define syslogstream_destroy(s) #endif -/**************************************************************************** - * Name: emergstream - * - * Description: - * Initializes a stream for use with the configured emergency syslog - * interface. Only accessible from with the OS SYSLOG logic. - * - * Input Parameters: - * stream - User allocated, uninitialized instance of struct - * lib_outstream_s to be initialized. - * - * Returned Value: - * None (User allocated instance initialized). - * - ****************************************************************************/ - -void emergstream(FAR struct lib_outstream_s *stream); - /**************************************************************************** * Name: lib_noflush *