summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2009-01-24 13:58:35 +0100
committerTobias Klauser <tklauser@distanz.ch>2009-01-24 13:58:35 +0100
commitb4d83d2e6ae0ec475371ca0fd400e72edc539710 (patch)
tree6e80738e6b5ff1673f984174392ec8a8dd7b032f
parentf6ae74eb0e94facb9fea8002ea86b5af1f6e593e (diff)
Move linked list structs for pipe_{bytes,lines} into these functions
-rw-r--r--inotail.c13
-rw-r--r--inotail.h15
2 files changed, 11 insertions, 17 deletions
diff --git a/inotail.c b/inotail.c
index 670d9fe..877a96d 100644
--- a/inotail.c
+++ b/inotail.c
@@ -289,7 +289,12 @@ static int tail_pipe_from_begin(struct file_struct *f, unsigned long n_units, co
static int tail_pipe_lines(struct file_struct *f, unsigned long n_lines)
{
- struct line_buf *first, *last, *tmp;
+ struct line_buf {
+ char buf[BUFSIZ];
+ size_t n_lines;
+ size_t n_bytes;
+ struct line_buf *next;
+ } *first, *last, *tmp;
int rc;
unsigned long total_lines = 0;
const char *p;
@@ -404,7 +409,11 @@ out:
/* TODO: Merge some parts (especially buffer handling) with tail_pipe_lines() */
static int tail_pipe_bytes(struct file_struct *f, unsigned long n_bytes)
{
- struct char_buf *first, *last, *tmp;
+ struct char_buf {
+ char buf[BUFSIZ];
+ size_t n_bytes;
+ struct char_buf *next;
+ } *first, *last, *tmp;
int rc;
unsigned long total_bytes = 0;
unsigned long i = 0; /* Index into buffer */
diff --git a/inotail.h b/inotail.h
index 93011e6..3d6c232 100644
--- a/inotail.h
+++ b/inotail.h
@@ -28,21 +28,6 @@ struct file_struct {
int i_watch; /* Inotify watch associated with file_struct */
};
-/* struct for linked list of buffers/lines in tail_pipe_lines */
-struct line_buf {
- char buf[BUFSIZ];
- size_t n_lines;
- size_t n_bytes;
- struct line_buf *next;
-};
-
-/* struct for linked list of byte buffers in tail_pipe_bytes */
-struct char_buf {
- char buf[BUFSIZ];
- size_t n_bytes;
- struct char_buf *next;
-};
-
#define IS_PIPELIKE(mode) \
(S_ISFIFO(mode) || S_ISSOCK(mode))
ude/linux/netlink.h?id=e32123e59871b9389d5b3fe9318611c7f1d1307a'>netlink: rename ssk to sk in struct netlink_skb_paramsPatrick McHardy1-1/+1 2012-10-13UAPI: (Scripted) Disintegrate include/linuxDavid Howells1-151/+1 2012-10-07netlink: add reference of module in netlink_dump_startGao feng1-4/+16 2012-09-23netlink: Rearrange netlink_kernel_cfg to save space on 64-bit.David S. Miller1-1/+1 2012-09-21netlink: use <linux/export.h> instead of <linux/module.h>Pablo Neira Ayuso1-1/+1 2012-09-10netlink: Rename pid to portid to avoid confusionEric W. Biederman1-7/+7 2012-09-08netlink: hide struct module parameter in netlink_kernel_createPablo Neira Ayuso1-3/+10 2012-09-08netlink: kill netlink_set_nonrootPablo Neira Ayuso1-5/+4 2012-09-07scm: Don't use struct ucred in NETLINK_CB and struct scm_cookie.Eric W. Biederman1-1/+2 2012-08-14netlink: Make the sending netlink socket availabe in NETLINK_CBEric W. Biederman1-0/+1 2012-06-29netlink: add nlk->netlink_bind hook for module auto-loadingPablo Neira Ayuso1-0/+1 2012-06-29netlink: add netlink_kernel_cfg parameter to netlink_kernel_createPablo Neira Ayuso1-5/+10 2012-06-26netlink: Delete NLMSG_PUT and NLMSG_NEW.David S. Miller1-8/+0 2012-05-08netfilter: remove ip_queue supportPablo Neira Ayuso1-1/+1 2012-02-26netlink: allow to pass data pointer to netlink_dump_start() callbackPablo Neira Ayuso1-0/+2 2012-02-26netlink: add netlink_dump_control structure for netlink_dump_start()Pablo Neira Ayuso1-3/+7 2012-01-30net: Deinline __nlmsg_put and genlmsg_put. -7k code on i386 defconfig.Denys Vlasenko1-16/+2 2011-12-06inet_diag: Partly rename inet_ to sock_Pavel Emelyanov1-1/+3 2011-11-01Merge git://github.com/herbertx/cryptoLinus Torvalds1-0/+1 2011-10-21crypto: Add userspace configuration APISteffen Klassert1-0/+1 2011-08-26headers, net: Use __kernel_sa_family_t in more definitions shared with userlandBen Hutchings1-1/+1 2011-08-07net: Make userland include of netlink.h more sane.David S. Miller1-1/+1 2011-06-24Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linvil...John W. Linville1-0/+2 2011-06-22netlink: advertise incomplete dumpsJohannes Berg1-0/+2 2011-06-09rtnetlink: Compute and store minimum ifinfo dump sizeGreg Rose1-2/+4 2011-05-20RDMA: Add netlink infrastructureRoland Dreier1-0/+1 2011-03-03netlink: kill eff_cap from struct netlink_skb_parmsPatrick McHardy1-1/+0 2011-03-03netlink: kill loginuid/sessionid/sid members from struct netlink_skb_parmsPatrick McHardy1-3/+0 2010-12-17netlink: fix gcc -Wconversion compilation warningDmitry V. Levin1-1/+1