Re: Current git tree broke busybox start-stop-daemon

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Al Viro <viro@...>
Cc: Joakim Tjernlund <joakim.tjernlund@...>, <linux-kernel@...>, <ebiederm@...>
Date: Wednesday, April 16, 2008 - 3:47 pm

On Wed, Apr 16, 2008 at 08:34:17PM +0100, Al Viro wrote:

Ugly ->index games, sigh...


Busybox just wants to estimate size of a file. And it knows about
zero-length /proc/*/stat .

libbb/read.c:

void *xmalloc_open_read_close(const char *filename, size_t *sizep)
{
	char *buf;
	size_t size = sizep ? *sizep : INT_MAX;
	int fd;
	off_t len;

	fd = xopen(filename, O_RDONLY);
	/* /proc/N/stat files report len 0 here */
	/* In order to make such files readable, we add small const */
	len = xlseek(fd, 0, SEEK_END) | 0x3ff; /* + up to 1k */
		...

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Current git tree broke busybox start-stop-daemon, Joakim Tjernlund, (Wed Apr 16, 1:25 pm)
Re: Current git tree broke busybox start-stop-daemon, Alexey Dobriyan, (Wed Apr 16, 3:00 pm)
Re: Current git tree broke busybox start-stop-daemon, Alexey Dobriyan, (Wed Apr 16, 3:47 pm)