diff options
authorTobias Klauser <>2006-10-20 17:55:55 +0200
committerTobias Klauser <tklauser@xenon.tklauser.home>2006-10-20 17:55:55 +0200
commit3e1ce3d550b37d6f833c01860b24166a89908576 (patch)
parenta1b88302d515b04255b5bd164378ee15d4c69a11 (diff)
inotail.c: Add basic support for +/-<num> to -c/-n
2 files changed, 9 insertions, 2 deletions
diff --git a/inotail.c b/inotail.c
index 1c5f8f0..123a3fa 100644
--- a/inotail.c
+++ b/inotail.c
@@ -328,8 +328,8 @@ int main(int argc, char **argv)
int i, c, ret = 0;
int n_files = 0;
- unsigned int n_units = DEFAULT_N_LINES;
- char forever = 0, mode = M_LINES;
+ int n_units = DEFAULT_N_LINES;
+ char forever = 0, mode = M_LINES, relative = R_END;
char **filenames;
struct file_struct *files;
@@ -339,6 +339,10 @@ int main(int argc, char **argv)
case 'n':
if (c == 'c')
mode = M_BYTES;
+ if (*optarg == '+')
+ relative = R_BEGIN;
+ else if (*optarg == '-')
+ optarg++;
n_units = strtoul(optarg, NULL, 0);
if (n_units < 0)
n_units = 0;
diff --git a/inotail.h b/inotail.h
index b47e6a4..40b0e29 100644
--- a/inotail.h
+++ b/inotail.h
@@ -7,6 +7,9 @@
/* tail modes */
enum { M_LINES, M_BYTES };
+/* tail unit relative to the end ('-' or none) or the beginning ('+' of the file) */
+enum { R_END, R_BEGIN };
/* Every tailed file is represented as a file_struct */
struct file_struct {
char *name; /* Name of file (or '-' for stdin) */
s.c?id=7b2106aea2638948806df248215b14efd84c5ffc'>cfg80211: remove radar requirements check from cfg80211_can_use_iftype_chan()Luciano Coelho1-4/+3 2014-02-04cfg80211: consider existing DFS interfacesMichal Kazior1-0/+2 2014-02-04cfg80211: fix channel configuration in IBSS joinAntonio Quartulli1-6/+11 2013-12-19cfg80211: Add support for QoS mappingKyeyoon Park1-0/+2 2013-12-06Merge branch 'master' of git:// W. Linville1-9/+9 2013-11-25cfg80211: consolidate passive-scan and no-ibss flagsLuis R. Rodriguez1-2/+2 2013-11-25cfg80211: fix ibss wext chandef creationSimon Wunderlich1-9/+9 2013-11-05Merge branch 'for-john' of git:// W. Linville1-4/+20 2013-10-28nl80211/cfg80211: enable DFS for IBSS modeSimon Wunderlich1-4/+20 2013-09-26cfg80211: fix warning when using WEXT for IBSSBruno Randolf1-0/+3 2013-06-04cfg80211: separate internal SME implementationJohannes Berg1-6/+0 2013-05-25cfg80211: vastly simplify lockingJohannes Berg1-8/+2 2013-02-11cfg80211: pass wiphy to cfg80211_ref_bss/put_bssJohannes Berg1-2/+2 2012-11-26nl80211/cfg80211: support VHT channel configurationJohannes Berg1-2/+2 2012-11-26cfg80211: pass a channel definition structJohannes Berg1-12/+15 2012-10-18cfg80211: add cfg80211 exported function tracingBeni Lev1-0/+2 2012-10-18cfg80211: add wrappers for registered_device_opsHila Gonen1-3/+4 2012-06-29cfg80211: respect iface combinations when starting operationMichal Kazior1-0/+10 2012-06-29cfg80211: track ibss fixed channelMichal Kazior1-0/+1 2012-06-04cfg80211: use sme_state in ibss start/join pathAmitkumar Karwar1-1/+5 2012-05-09wireless: Convert compare_ether_addr to ether_addr_equalJoe Perches1-1/+1 2011-10-31net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modulesPaul Gortmaker1-0/+1 2010-10-06cfg80211/mac80211: allow per-station GTKsJohannes Berg1-1/+1 2010-09-28cfg80211: always set IBSS basic ratesJohannes Berg1-0/+19 2010-07-26cfg80211: fix IBSS default management keyJohannes Berg1-1/+3 2010-05-11Merge branch 'master' of git:// W. Linville1-5/+0 2010-05-07cfg80211/mac80211: better channel handlingJohannes Berg1-5/+0