Re: [PATCH 2/8] Add a lockfile function to append to a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 19 Apr 2008, Junio C Hamano wrote:

> Daniel Barkalow <barkalow@xxxxxxxxxxxx> writes:
> 
> > This takes care of copying the original contents into the replacement
> > file after the lock is held, so that concurrent additions can't miss
> > each other's changes.
> >
> > Signed-off-by: Daniel Barkalow <barkalow@xxxxxxxxxxxx>
> > ---
> > How about this? Also doesn't leak a fd and catches trying to append to a 
> > file you can't read. Should I worry about mmap failing after the open?
> 
> We have copy.c to copy small existing files, while detecting failure to
> copy properly.  How about doing something like this instead?

Yeah, that's obviously the right thing to use.

	-Daniel
*This .sig left intentionally blank*
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux