diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2005-12-31 14:16:49 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2005-12-31 14:16:49 +0000 |
commit | cceba5593d7a02ad4564f86154dd62f9ac05b08b (patch) | |
tree | 763f9b32ffce32f0d79ee89cfe4411098cd18df1 | |
parent | 1b68dd91cf5a3a2642f2bdb09065dc59a884028b (diff) | |
download | newlib-cceba5593d7a02ad4564f86154dd62f9ac05b08b.zip newlib-cceba5593d7a02ad4564f86154dd62f9ac05b08b.tar.gz newlib-cceba5593d7a02ad4564f86154dd62f9ac05b08b.tar.bz2 |
* syslog.cc (vsyslog): Decrement len if trailing \n has been removed.
Add \n when writing to stderr if LOG_PERROR option is set.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/syslog.cc | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ad8008f..bde9580 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2005-12-31 Corinna Vinschen <corinna@vinschen.de> + * syslog.cc (vsyslog): Decrement len if trailing \n has been removed. + Add \n when writing to stderr if LOG_PERROR option is set. + +2005-12-31 Corinna Vinschen <corinna@vinschen.de> + * include/cygwin/in.h: Drop including stdint.h. Move definition of in_port_t and in_addr_t to top of file and use throughout. Use sa_family_t type where appropriate. diff --git a/winsup/cygwin/syslog.cc b/winsup/cygwin/syslog.cc index 2ea0d62..b8bd669 100644 --- a/winsup/cygwin/syslog.cc +++ b/winsup/cygwin/syslog.cc @@ -402,12 +402,15 @@ vsyslog (int priority, const char *message, va_list ap) char *total_msg = pass.get_message (); int len = strlen (total_msg); if (len != 0 && (total_msg[len - 1] == '\n')) - total_msg[len - 1] = '\0'; + total_msg[--len] = '\0'; msg_strings[0] = total_msg; if (_my_tls.locals.process_logopt & LOG_PERROR) - write (STDERR_FILENO, total_msg, len + 1); + { + write (STDERR_FILENO, total_msg, len); + write (STDERR_FILENO, "\n", 1); + } int fd; if ((fd = try_connect_syslogd (priority, total_msg, len + 1)) >= 0) |