[PATCH 5 of 5] chg: forward umask from client to server

Jun Wu quark at fb.com
Tue Feb 16 10:24:32 EST 2016


On 02/16/2016 02:26 PM, Yuya Nishihara wrote:
>> +static void forwardumask(hgclient_t *hgc)
>> +{
>> +	mode_t mask = umask(0);
>> +	int n = snprintf(hgc->ctx.data, hgc->ctx.maxdatasize, "%d", mask);
>> +	if (n >= (int)hgc->ctx.maxdatasize || n <= 0)
>> +		abortmsg("unexpected umask length (%d)", n);
>> +	hgc->ctx.datasize = (size_t)n;
>> +	writeblockrequest(hgc, "umask");
>> +	umask(mask);
>> +}
>
> Nit: I prefer doing umask(mask) immediately to narrow the scope.

I was thinking from another point of view: to make the server start
working asap so send data earlier. Although umask is surely too fast
to notice the difference.




More information about the Mercurial-devel mailing list