Re: [PATCH v2 1/4] Introduce a function to lock/unlock file descriptors when appending

2018-08-10 Thread Johannes Schindelin
Hi Junio, On Fri, 10 Aug 2018, Junio C Hamano wrote: > "Johannes Schindelin via GitGitGadget" > writes: > > > + > > +#ifndef GIT_WINDOWS_NATIVE > > +int lock_or_unlock_fd_for_appending(int fd, int lock_it) > > +{ > > + struct flock flock; > > + > > + flock.l_type = lock_it ? F_WRLCK : F_UNL

Re: [PATCH v2 1/4] Introduce a function to lock/unlock file descriptors when appending

2018-08-10 Thread Junio C Hamano
"Johannes Schindelin via GitGitGadget" writes: > + > +#ifndef GIT_WINDOWS_NATIVE > +int lock_or_unlock_fd_for_appending(int fd, int lock_it) > +{ > + struct flock flock; > + > + flock.l_type = lock_it ? F_WRLCK : F_UNLCK; > + > + /* (un-)lock the whole file */ > + flock.l_whence =

[PATCH v2 1/4] Introduce a function to lock/unlock file descriptors when appending

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This function will be used to make write accesses in trace_write() a bit safer. Note: this patch takes a very different approach for cross-platform support than Git is historically taking: the original approach is to first implement everything on Linux, using the functi