Re: git-credential-cache--daemon quits on SIGHUP, can we change it to ignore instead?

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

 



Jeff King <peff@xxxxxxxx> writes:

>> diff --git a/credential-cache--daemon.c b/credential-cache--daemon.c
>> index eef6fce..6cda9c0 100644
>> --- a/credential-cache--daemon.c
>> +++ b/credential-cache--daemon.c
>> @@ -256,6 +256,9 @@ int main(int argc, const char **argv)
>>  		OPT_END()
>>  	};
>>  
>> +	int ignore_sighup = 0;
>> +	git_config_get_bool("credentialcache.ignoresighup", &ignore_sighup);
>> +
>
> Style-wise, I think the declaration should go above the options-list.

I was about to merge this to 'master', following your last issue of
"What's cooking" report.

I was puzzled that git_config_get_bool() is used here without even
checking if we are inside any Git repository and wondered if it was
correct.  I'd imagine this is not a problem, as this process is
spawned by "credential-cache" that was spawned by somebody (either
push or fetch) who has read $GIT_DIR/config for credential.helper to
determine that credential-cache needs to be used.

>> @@ -264,6 +267,10 @@ int main(int argc, const char **argv)
>>  
>>  	check_socket_directory(socket_path);
>>  	register_tempfile(&socket_file, socket_path);
>> +
>> +	if (ignore_sighup)
>> +		signal(SIGHUP, SIG_IGN);
>> +
>
> This part looks obviously correct. :)
>
> I don't think there's any need to use sigchain_push here (we have no
> intention of ever popping it).
>
> -Peff
--
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]