From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wei.liu2@citrix.com>, Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: [PATCH 4/6] xenconsoled: delete two now unused functions
Date: Mon, 6 Jun 2016 16:59:39 +0100 [thread overview]
Message-ID: <1465228781-22754-5-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1465228781-22754-1-git-send-email-wei.liu2@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
tools/console/daemon/io.c | 47 -----------------------------------------------
1 file changed, 47 deletions(-)
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index c2f63e6..7c38232 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -113,21 +113,6 @@ struct domain {
static struct domain *dom_head;
-static int write_all(int fd, const char* buf, size_t len)
-{
- while (len) {
- ssize_t ret = write(fd, buf, len);
- if (ret == -1 && errno == EINTR)
- continue;
- if (ret <= 0)
- return -1;
- len -= ret;
- buf += ret;
- }
-
- return 0;
-}
-
static int write_logfile(struct logfile *logfile, const char *buf,
size_t len)
{
@@ -137,38 +122,6 @@ static int write_logfile(struct logfile *logfile, const char *buf,
return 0;
}
-static __attribute__((unused))
-int write_with_timestamp(int fd, const char *data, size_t sz,
- int *needts)
-{
- char ts[32];
- time_t now = time(NULL);
- const struct tm *tmnow = localtime(&now);
- size_t tslen = strftime(ts, sizeof(ts), "[%Y-%m-%d %H:%M:%S] ", tmnow);
- const char *last_byte = data + sz - 1;
-
- while (data <= last_byte) {
- const char *nl = memchr(data, '\n', last_byte + 1 - data);
- int found_nl = (nl != NULL);
- if (!found_nl)
- nl = last_byte;
-
- if ((*needts && write_all(fd, ts, tslen))
- || write_all(fd, data, nl + 1 - data))
- return -1;
-
- *needts = found_nl;
- data = nl + 1;
- if (found_nl) {
- // If we printed a newline, strip all \r following it
- while (data <= last_byte && *data == '\r')
- data++;
- }
- }
-
- return 0;
-}
-
static int write_logfile_with_timestamp(struct logfile *logfile,
const char *data, size_t sz,
int *needts)
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-06-06 15:59 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 15:59 [PATCH 0/6] xenconsoled: rotating log file abstration Wei Liu
2016-06-06 15:59 ` [PATCH 1/6] xenconsoled: introduce log file abstraction Wei Liu
2016-07-08 16:50 ` Ian Jackson
2016-06-06 15:59 ` [PATCH 2/6] xenconsoled: switch hypervisor log to use logfile abstraction Wei Liu
2016-07-08 16:58 ` Ian Jackson
2016-06-06 15:59 ` [PATCH 3/6] xenconsoled: switch guest " Wei Liu
2016-07-08 17:01 ` Ian Jackson
2016-06-06 15:59 ` Wei Liu [this message]
2016-07-08 17:01 ` [PATCH 4/6] xenconsoled: delete two now unused functions Ian Jackson
2016-06-06 15:59 ` [PATCH 5/6] xenconsoled: options to control log rotation Wei Liu
2016-07-08 17:02 ` Ian Jackson
2016-06-06 15:59 ` [PATCH 6/6] xenconsoled: handle --log-backups 0 in logfile_rollover Wei Liu
2016-07-08 17:03 ` Ian Jackson
2016-06-06 20:40 ` [PATCH 0/6] xenconsoled: rotating log file abstration Doug Goldstein
2016-06-07 8:07 ` Wei Liu
2016-06-07 9:44 ` David Vrabel
2016-06-07 9:55 ` Wei Liu
2016-06-07 10:17 ` David Vrabel
2016-06-07 10:21 ` Wei Liu
2016-06-07 10:29 ` David Vrabel
2016-06-07 10:34 ` Wei Liu
2016-06-07 10:35 ` David Vrabel
2016-06-07 10:43 ` Wei Liu
2016-07-02 10:24 ` Wei Liu
2016-07-04 17:07 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1465228781-22754-5-git-send-email-wei.liu2@citrix.com \
--to=wei.liu2@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).