diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-01-16 23:06:37 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-01-16 23:06:37 +1100 |
commit | 5683a8d1e1f1845fae344985d28d2bce7972a4c8 (patch) | |
tree | 20c20f35d13b7e81e8434ebe4efed08a3967afea | |
parent | be9594c156a175335629aacdd1a0bc514046dd41 (diff) | |
download | samba-5683a8d1e1f1845fae344985d28d2bce7972a4c8.tar.gz samba-5683a8d1e1f1845fae344985d28d2bce7972a4c8.tar.xz samba-5683a8d1e1f1845fae344985d28d2bce7972a4c8.zip |
cope better with large debug dumps
(This used to be ctdb commit fc3733f8e966376f50799fd1aa7b0a8e1cf66e0e)
-rw-r--r-- | ctdb/server/ctdb_logging.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ctdb/server/ctdb_logging.c b/ctdb/server/ctdb_logging.c index c733409c68..126adadb26 100644 --- a/ctdb/server/ctdb_logging.c +++ b/ctdb/server/ctdb_logging.c @@ -119,15 +119,13 @@ static void ctdb_log_handler(struct event_context *ev, struct fd_event *fde, ctdb->log->buf_used += n1; } - if (ctdb->log->buf_used == sizeof(ctdb->log->buf)) { - do_debug("%*.*s\n", - (int)ctdb->log->buf_used, (int)ctdb->log->buf_used, ctdb->log->buf); - ctdb->log->buf_used = 0; - return; - } - p = memchr(ctdb->log->buf, '\n', ctdb->log->buf_used); if (!p) { + if (ctdb->log->buf_used == sizeof(ctdb->log->buf)) { + do_debug("%*.*s\n", + (int)ctdb->log->buf_used, (int)ctdb->log->buf_used, ctdb->log->buf); + ctdb->log->buf_used = 0; + } return; } |