Changeset 1772 in MondoRescue for branches/2.2.5/mindi-busybox/coreutils/tail.c
- Timestamp:
- Nov 6, 2007, 9:23:18 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.5/mindi-busybox/coreutils/tail.c
r1765 r1772 48 48 { 49 49 ssize_t r; 50 off_t current , end;50 off_t current; 51 51 struct stat sbuf; 52 52 53 end = current = lseek(fd, 0, SEEK_CUR); 54 if (!fstat(fd, &sbuf)) 55 end = sbuf.st_size; 56 lseek(fd, end < current ? 0 : current, SEEK_SET); 53 /* (A good comment is missing here) */ 54 current = lseek(fd, 0, SEEK_CUR); 55 /* /proc files report zero st_size, don't lseek them. */ 56 if (fstat(fd, &sbuf) == 0 && sbuf.st_size) 57 if (sbuf.st_size < current) 58 lseek(fd, 0, SEEK_SET); 59 57 60 r = safe_read(fd, buf, count); 58 61 if (r < 0) { … … 68 71 static unsigned eat_num(const char *p) 69 72 { 70 if (*p == '-') p++; 71 else if (*p == '+') { p++; G.status = EXIT_FAILURE; } 73 if (*p == '-') 74 p++; 75 else if (*p == '+') { 76 p++; 77 G.status = EXIT_FAILURE; 78 } 72 79 return xatou_sfx(p, tail_suffixes); 73 80 }
Note:
See TracChangeset
for help on using the changeset viewer.