lkml.org 
[lkml]   [2008]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] seq_file: make seq_lseek accept SEEK_END
Date
Apologies for delay, such simple thing should have been sent long ago.
Joakim, please, confirm.
-------------------------------------------
[PATCH] seq_file: make seq_lseek accept SEEK_END

and pretend seq_files have zero length. This should be enough
to fix busybox start-stop-daemon:
http://marc.info/?t=120836691600002&r=1&w=2

It does xlseek(fd, 0, SEEK_END) to estimate amount of memory to malloc
but satisfied with 0. Sudden -EINVAL from lseek(2) breaks it.

X-Introduced-By: f16278c679aa72e28288435b313ba2d4494d6be5
Signed-off-by: Alexey Dobriyan <adobriyan@parallels.com>
---

fs/seq_file.c | 2 ++
1 file changed, 2 insertions(+)

--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -254,6 +254,8 @@ loff_t seq_lseek(struct file *file, loff_t offset, int origin)
switch (origin) {
case 1:
offset += file->f_pos;
+ case 2:
+ /* pretend it's zero length */
case 0:
if (offset < 0)
break;

\
 
 \ /
  Last update: 2008-06-09 13:03    [W:0.049 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site