[-]
[+]
|
Changed |
multitail.spec
|
|
|
Renamed |
multitail-5.2.10.diff
^
|
[-]
[+]
|
Changed |
multitail-5.2.10.tar.bz2/Makefile
^
|
@@ -3,6 +3,7 @@
DESTDIR=/
CONFIG_FILE=$(DESTDIR)/etc/multitail.conf
+CC=gcc
DEBUG=-g # -D_DEBUG # -pg # -D_DEBUG #-pg -W -pedantic # -pg #-fprofile-arcs
LDFLAGS+=-lpanel -lncurses -lutil -lm $(DEBUG) -rdynamic
# LDFLAGS+=-lc_p -lpanel_g -lncurses_g -lutil -lm -pg -g -rdynamic
|
[-]
[+]
|
Changed |
multitail-5.2.10.tar.bz2/cmdline.c
^
|
@@ -182,11 +182,16 @@
void add_redir_to_socket(char filtered, char *prio, char *fac, char *address, redirect_t **predir, int *n_redirect)
{
- struct hostent *hp;
char *local_address = mystrdup(address, __FILE__, __PRETTY_FUNCTION__, __LINE__);
char *colon = strchr(local_address, ':');
int prio_nr = -1, fac_nr = -1;
int loop;
+ char* node;
+ char* service;
+ struct addrinfo hints;
+ struct addrinfo* result;
+ struct addrinfo* rp;
+ int s, sfd = -1;
*predir = (redirect_t *)myrealloc(*predir, (*n_redirect) * sizeof(redirect_t), __FILE__, __PRETTY_FUNCTION__, __LINE__);
@@ -199,21 +204,44 @@
(*predir)[*n_redirect].redirect = mystrdup(address, __FILE__, __PRETTY_FUNCTION__, __LINE__);
- (*predir)[*n_redirect].fd = socket(AF_INET, SOCK_DGRAM, 0);
- if ((*predir)[*n_redirect].fd == -1)
- error_exit(__FILE__, __PRETTY_FUNCTION__, __LINE__, "Cannot create socket for redirecting via syslog protocol.\n");
-
- memset(&(*predir)[*n_redirect].sai, 0x00, sizeof((*predir)[*n_redirect].sai));
- (*predir)[*n_redirect].sai.sin_family = AF_INET;
if (colon)
{
*colon = 0x00;
- (*predir)[*n_redirect].sai.sin_port = atoi(colon + 1);
+ node = local_address;
+ service = colon + 1;
}
else
- (*predir)[*n_redirect].sai.sin_port = 514;
- hp = gethostbyname(local_address);
- memcpy(&(*predir)[*n_redirect].sai.sin_addr.s_addr, hp -> h_addr, hp -> h_length);
+ {
+ node = local_address;
+ service = "syslog";
+ }
+
+ memset(&hints, 0x00, sizeof(struct addrinfo));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_flags = 0;
+ hints.ai_protocol = 0;
+
+ s = getaddrinfo(node, service, &hints, &result);
+ if (s != 0)
+ error_exit(__FILE__, __PRETTY_FUNCTION__, __LINE__, "Cannot create socket for redirecting via syslog protocol: %s.\n", gai_strerror(s));
+
+ for (rp = result; rp != NULL; rp = rp -> ai_next)
+ {
+ sfd = socket(rp -> ai_family, rp -> ai_socktype, rp -> ai_protocol);
+ if (sfd == -1)
+ continue;
+ if (connect(sfd, rp -> ai_addr, rp -> ai_addrlen) != -1)
+ break;
+ close(sfd);
+ }
+
+ freeaddrinfo(result);
+
+ if (rp == NULL)
+ error_exit(__FILE__, __PRETTY_FUNCTION__, __LINE__, "Cannot create socket for redirecting via syslog protocol.\n");
+
+ (*predir)[*n_redirect].fd = sfd;
for(loop=0; loop<8; loop++)
{
@@ -550,7 +578,7 @@
int_array_t cur_color_schemes = { NULL, 0, 0 };
myattr_t cdef = { -1, -1 };
int window_height = -1;
- int initial_n_lines_tail = -1;
+ int initial_n_lines_tail = min_n_bufferlines;
char *win_title = NULL;
term_t cur_term_emul = TERM_IGNORE;
strip_t *pstrip = NULL;
@@ -765,6 +793,10 @@
{
initial_n_lines_tail = get_value_arg("-n", argv[++loop], VAL_ZERO_POSITIVE);
}
+ else if (strcmp(argv[loop], "-N") == 0)
+ {
+ initial_n_lines_tail = min_n_bufferlines = get_value_arg("-n", argv[++loop], VAL_ZERO_POSITIVE);
+ }
else if (strcmp(argv[loop], "-b") == 0)
{
tab_width = get_value_arg("-b", argv[++loop], VAL_ZERO_POSITIVE);
@@ -1007,7 +1039,7 @@
/* see if file exists */
if (check_interval == 0 && is_cmd == 0 && is_stdin == 0 && is_sock == 0 && retry == 0 && stat64(dummy, &buf) == -1)
{
- fprintf(stderr, "Error opening file %s.\n", dummy);
+ fprintf(stderr, "Error opening file %s (%s)\n", dummy, strerror(errno));
exit(EXIT_FAILURE);
}
@@ -1039,7 +1071,7 @@
/* initial number of lines to tail */
cur -> initial_n_lines_tail = initial_n_lines_tail;
- initial_n_lines_tail = -1;
+ initial_n_lines_tail = min_n_bufferlines;
/* default window height */
cur -> win_height = window_height;
|
[-]
[+]
|
Changed |
multitail-5.2.10.tar.bz2/error.c
^
|
@@ -21,19 +21,32 @@
void error_exit(char *file, const char *function, int line, char *format, ...)
{
va_list ap;
+ int index;
+ void *trace[128];
+ int trace_size = backtrace(trace, 128);
+ char **messages = backtrace_symbols(trace, trace_size);
(void)endwin();
fprintf(stderr, version_str, VERSION);
fprintf(stderr, "\n\n");
- fprintf(stderr,"A problem occured at line %d in function %s (from file %s):\n\n", line, function, file);
+ fprintf(stderr, "The following error occured:\n");
+ fprintf(stderr, "---------------------------\n");
va_start(ap, format);
(void)vfprintf(stderr, format, ap);
va_end(ap);
- if (errno) fprintf(stderr, "\nerrno variable (if applicable): %d which means %s\n\n", errno, strerror(errno));
- fprintf(stderr, "\nBinary build at %s %s\n", __DATE__, __TIME__);
+ fprintf(stderr, "\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, "If this is a bug, please report the following information:\n");
+ fprintf(stderr, "---------------------------------------------------------\n");
+ fprintf(stderr, "This problem occured at line %d in function %s (from file %s):\n", line, function, file);
+ if (errno) fprintf(stderr, "errno variable was then: %d which means \"%s\"\n", errno, strerror(errno));
+ fprintf(stderr, "Binary build at %s %s\n", __DATE__, __TIME__);
+ fprintf(stderr, "Execution path:\n");
+ for(index=0; index<trace_size; ++index)
+ fprintf(stderr, "\t%d %s\n", index, messages[index]);
dump_mem(SIGHUP);
|
[-]
[+]
|
Changed |
multitail-5.2.10.tar.bz2/globals.c
^
|
@@ -31,7 +31,7 @@
int *n_win_per_col = NULL;
int *vertical_split = NULL;
color_scheme *cschemes = NULL;
-const char *version_str = " --*- multitail " VERSION " (C) 2003-2007 by folkert@vanheusden.com -*--";
+const char *version_str = " --*- multitail " VERSION " (C) 2003-2012 by folkert@vanheusden.com -*--";
conversion *conversions = NULL;
keybinding *keybindings = NULL;
pars_per_file *ppf = NULL;
@@ -47,7 +47,7 @@
int terminal_main_index = -1;
int default_color_scheme = -1;
int max_y, max_x;
-int min_n_bufferlines = 25;
+int min_n_bufferlines = -1;
int mode_statusline = 1;
int n_children = 0;
int n_conversions = 0;
|
[-]
[+]
|
Changed |
multitail-5.2.10.tar.bz2/mt.c
^
|
@@ -385,7 +385,16 @@
void select_display_start_and_end(char *string, char mode, int wrap_offset, int win_width, int *prt_start, int *prt_end, int *disp_end)
{
- int nbytes = strlen(string);
+ /* patch by Thomas Gartner */
+ int nbytes = 0; /* = strlen(string); */
+ char *tmpString=string;
+ while(string && *tmpString)
+ {
+ if (*tmpString++==9)
+ nbytes += tab_width;
+ else
+ ++nbytes;
+ }
*prt_start = 0;
*prt_end = nbytes;
@@ -455,7 +464,7 @@
return 0;
}
-
+
char find_highlight_matches(regmatch_t *matches, char use_regex, int offset)
{
int match_offset;
@@ -482,65 +491,65 @@
myattr_t * find_cmatches_index(color_offset_in_line *cmatches, int n_cmatches, mybool_t has_merge_colors, int offset)
{
- static myattr_t final_color;
- int cmatches_index = 0;
- int fg_composed = -1, bg_composed = -1;
- int attrs = -1;
- char first_set = 1;
-
- for(cmatches_index=0; cmatches_index<n_cmatches; cmatches_index++)
- {
- if (offset >= cmatches[cmatches_index].start && offset < cmatches[cmatches_index].end)
- {
- if (has_merge_colors == MY_FALSE)
- {
- return &cmatches[cmatches_index].attrs;
- }
-
- if (cmatches[cmatches_index].merge_color == MY_TRUE)
- {
- /* merge these colors */
- if (cmatches[cmatches_index].attrs.colorpair_index != -1)
- {
- int fg_fc, bg_fc;
-
- fg_fc = cp.fg_color[cmatches[cmatches_index].attrs.colorpair_index];
- bg_fc = cp.bg_color[cmatches[cmatches_index].attrs.colorpair_index];
-
- if (fg_fc != -1 && fg_composed == -1)
- fg_composed = fg_fc;
- if (bg_fc != -1 && bg_composed == -1)
- bg_composed = bg_fc;
- }
-
- if (cmatches[cmatches_index].attrs.attrs != -1)
- {
- if (attrs == -1)
- attrs = cmatches[cmatches_index].attrs.attrs;
- else
- attrs |= cmatches[cmatches_index].attrs.attrs;
- }
- }
- else if (first_set)
- {
- first_set = 0;
-
- fg_composed = cp.fg_color[cmatches[cmatches_index].attrs.colorpair_index];
- bg_composed = cp.bg_color[cmatches[cmatches_index].attrs.colorpair_index];
- attrs = cmatches[cmatches_index].attrs.attrs;
- }
- }
- }
-
- if (fg_composed != -1 || bg_composed != -1 || final_color.attrs != -1)
- {
- final_color.attrs = attrs;
- final_color.colorpair_index = find_or_init_colorpair(fg_composed, bg_composed, 1);
+ static myattr_t final_color;
+ int cmatches_index = 0;
+ int fg_composed = -1, bg_composed = -1;
+ int attrs = -1;
+ char first_set = 1;
+
+ for(cmatches_index=0; cmatches_index<n_cmatches; cmatches_index++)
+ {
+ if (offset >= cmatches[cmatches_index].start && offset < cmatches[cmatches_index].end)
+ {
+ if (has_merge_colors == MY_FALSE)
+ {
+ return &cmatches[cmatches_index].attrs;
+ }
+
+ if (cmatches[cmatches_index].merge_color == MY_TRUE)
+ {
+ /* merge these colors */
+ if (cmatches[cmatches_index].attrs.colorpair_index != -1)
+ {
+ int fg_fc, bg_fc;
+
+ fg_fc = cp.fg_color[cmatches[cmatches_index].attrs.colorpair_index];
+ bg_fc = cp.bg_color[cmatches[cmatches_index].attrs.colorpair_index];
+
+ if (fg_fc != -1 && fg_composed == -1)
+ fg_composed = fg_fc;
+ if (bg_fc != -1 && bg_composed == -1)
+ bg_composed = bg_fc;
+ }
+
+ if (cmatches[cmatches_index].attrs.attrs != -1)
+ {
+ if (attrs == -1)
+ attrs = cmatches[cmatches_index].attrs.attrs;
+ else
+ attrs |= cmatches[cmatches_index].attrs.attrs;
+ }
+ }
+ else if (first_set)
+ {
+ first_set = 0;
+
+ fg_composed = cp.fg_color[cmatches[cmatches_index].attrs.colorpair_index];
+ bg_composed = cp.bg_color[cmatches[cmatches_index].attrs.colorpair_index];
+ attrs = cmatches[cmatches_index].attrs.attrs;
+ }
+ }
+ }
- return &final_color;
- }
+ if (fg_composed != -1 || bg_composed != -1 || final_color.attrs != -1)
+ {
+ final_color.attrs = attrs;
+ final_color.colorpair_index = find_or_init_colorpair(fg_composed, bg_composed, 1);
- return NULL;
+ return &final_color;
+ }
+
+ return NULL;
}
void gen_wordwrap_offsets(char *string, int start_offset, int end_offset, int win_width, int **offsets)
@@ -712,7 +721,7 @@
{
char reverse = 0;
myattr_t cdev = { -1, -1 };
- int prt_start = 0, prt_end, disp_end;
+ int prt_start = 0, prt_end = 0, disp_end = 0;
int mx = -1;
char use_regex = 0;
color_offset_in_line *cmatches = NULL;
@@ -863,7 +872,7 @@
/* check if the current line matches with a regular expression
returns 0 if a regexp failed to execute
- */
+ */
/* this code can be optimized quit a bit but I wanted to get it to work quickly so I expanded everything (2006/03/28) */
char check_filter(proginfo *cur, char *string, regmatch_t **pmatch, char **error, int *matching_regex, char do_re, char *display)
@@ -874,7 +883,8 @@
char re_exec_ok = 1;
*error = NULL;
- *pmatch = NULL;
+ if (pmatch)
+ *pmatch = NULL;
*matching_regex = -1;
*display = 1;
@@ -2295,33 +2305,56 @@
{
char *dummy = mystrdup(cur -> filename, __FILE__, __PRETTY_FUNCTION__, __LINE__);
char *colon = strchr(dummy, ':');
- struct sockaddr_in sa;
- socklen_t ssai_len = sizeof(sa);
- char *host = "0.0.0.0";
- int port = 514;
+ struct addrinfo hints;
+ struct addrinfo* result;
+ struct addrinfo* rp;
+ int sfd, s;
- cur -> wfd = cur -> fd = socket(AF_INET, SOCK_DGRAM, 0);
- if (cur -> fd == -1)
- error_exit(__FILE__, __PRETTY_FUNCTION__, __LINE__, "Failed to create socket for receiving syslog data.\n");
+ char *host = NULL;
+ char *service = "syslog";
if (colon)
{
- port = atoi(colon + 1);
- if (port <= 0)
- error_exit(__FILE__, __PRETTY_FUNCTION__, __LINE__, "--[Ll]isten requires a >= 0 portnumber.\n");
+ service = colon + 1;
*colon = 0x00;
if (colon > dummy)
host = dummy;
}
- memset(&sa, 0x00, ssai_len);
- sa.sin_family = AF_INET;
- sa.sin_port = htons(port);
- sa.sin_addr.s_addr = inet_addr(host);
- if (bind(cur -> fd, (struct sockaddr *)&sa, ssai_len) == -1)
- error_exit(__FILE__, __PRETTY_FUNCTION__, __LINE__, "Failed to bind socket to %s.\n", cur -> filename);
+ memset(&hints, 0x00, sizeof(struct addrinfo));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_flags = AI_PASSIVE;
+ hints.ai_protocol = 0;
+ hints.ai_canonname = NULL;
+ hints.ai_addr = NULL;
+ hints.ai_next = NULL;
+
+ s = getaddrinfo(host, service, &hints, &result);
+ if (s != 0)
+ error_exit(__FILE__, __PRETTY_FUNCTION__, __LINE__, "Failed to create socket for receiving syslog data on %s: %s.\n", cur -> filename, gai_strerror(s));
+
+ for (rp = result; rp != NULL; rp = rp -> ai_next)
+ {
+ sfd = socket(rp -> ai_family, rp -> ai_socktype, rp -> ai_protocol);
+ if (sfd == -1)
+ continue;
+ if (bind(sfd, rp -> ai_addr, rp -> ai_addrlen) == 0)
+ break;
+ close(sfd);
+ }
+
+ freeaddrinfo(result);
+
+ if (rp == NULL)
+ error_exit(__FILE__, __PRETTY_FUNCTION__, __LINE__, "Failed to create socket for receiving syslog data on %s.\n", cur -> filename);
+
+ cur -> wfd = cur -> fd = sfd;
- myfree(dummy);
+ cur -> wfd = cur -> fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (cur -> fd == -1)
+
+ myfree(dummy);
cur -> pid = -1;
}
|
[-]
[+]
|
Changed |
multitail-5.2.10.tar.bz2/mt.h
^
|
@@ -48,7 +48,7 @@
#define __USE_BSD /* manpage says _BSD_SOURCE, stdlib.h says __USE_BSD */
#endif
-#if defined(sun) || defined(__sun) || defined(scoos) || defined(_HPUX_SOURCE) || defined(AIX)
+#if defined(sun) || defined(__sun) || defined(scoos) || defined(_HPUX_SOURCE) || defined(AIX) || defined(__CYGWIN__)
#include <ncurses/panel.h>
#include <ncurses/ncurses.h>
#else
|
[-]
[+]
|
Changed |
multitail-5.2.10.tar.bz2/multitail.1
^
|
@@ -103,6 +103,9 @@
.B "\-n" number_of_lines
Number of lines to tail initially. The default depends on the size of the terminal-window.
.TP
+.B "\-N" number_of_lines
+Like -n but this parameter will be used for all files/commands you tail after this parameter.
+.TP
.B "\-r" interval
Restart the command (started with -l/-L) after it has exited. With interval you can set how long to sleep before restarting.
.TP
|
[-]
[+]
|
Changed |
multitail-5.2.10.tar.bz2/multitail.conf
^
|
@@ -130,6 +130,30 @@
cs_re:yellow:Failed [^ ]* for [^ ]* from [^ ]* port [0-9]* .*
cs_re:red:Disconnecting: Too many authentication failures for.*
#
+# ADB logcat
+colorscheme:logcat
+cs_re_s:blue,,bold:^./(dalvikvm)\(
+cs_re_s:blue,,bold:^./(Process)\(
+cs_re_s:cyan:^./(ActivityManager)\(
+cs_re_s:cyan:^./(ActivityThread)\(
+cs_re_s:white,,bold:^./([^\(]*)\(
+cs_re_s:green:^[^\(]*(\()[^\)]*(\))
+cs_re:red,,inverse:[Pp]ermission [Dd]eni[ae][dl]
+cs_re:red,,inverse:Caused by:
+cs_re:cyan::
+#cs_re:red,,inverse:^F
+#cs_re:red,,bold:^E
+#cs_re:yellow,,bold:^W
+#cs_re:cyan,,bold:^I
+#cs_re:green,,bold:^V
+#cs_re:white:^D
+cs_re_s:red,,inverse:^(F)/[^:]*: (.*)$
+cs_re_s:red:^(E)/[^:]*: (.*)$
+cs_re_s:yellow:^(W).[^:]*: (.*)$
+#cs_re_s:green:^(I).[^:]*: (.*)$
+cs_re_s:green:^(V)/[^:]*: (.*)$
+cs_re_s:black,,bold:^(D)/[^:]*: (.*)$
+#
# linux iptables firewall
colorscheme:liniptfw:Linux IPtables (2.6.x kernel)
cs_re:cyan::
|
[-]
[+]
|
Changed |
multitail-5.2.10.tar.bz2/scrollback.c
^
|
@@ -746,6 +746,7 @@
if ((rc=regcomp(®, search_for, REG_EXTENDED | (case_insensitive == MY_TRUE?REG_ICASE:0))))
{
regexp_error_popup(rc, ®);
+ free(last_check);
return;
}
}
|
[-]
[+]
|
Changed |
multitail-5.2.10.tar.bz2/ui.c
^
|
@@ -2449,7 +2449,7 @@
void regexp_error_popup(int rc, regex_t *pre)
{
- char popup_buffer[4096];
+ char popup_buffer[4096] = { 0 };
char *error = convert_regexp_error(rc, pre);
if (error)
@@ -2465,7 +2465,9 @@
popup_buffer[sizeof(popup_buffer) - 1] = 0x00;
}
else
- strncat(popup_buffer, error, sizeof(popup_buffer));
+ {
+ strncat(popup_buffer, error, sizeof(popup_buffer)-strlen(popup_buffer)-1);
+ }
myfree(error);
}
|
[-]
[+]
|
Changed |
multitail-5.2.10.tar.bz2/utils.c
^
|
@@ -4,6 +4,7 @@
#include <signal.h>
#include <stdlib.h>
#include <limits.h>
+#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <regex.h>
|
[-]
[+]
|
Changed |
multitail-5.2.10.tar.bz2/version
^
|
@@ -1 +1 @@
-VERSION=5.2.9
+VERSION=5.2.10
|