Re: [PATCH 2/7] lockfile: introduce alloc_lock_file() to avoid valgrind noise

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

 



Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@xxxxxxxxx> writes:

>> -	while (lock_file_list) {
>> -		if (lock_file_list->owner == me &&
>> -		    lock_file_list->filename[0]) {
>> -			if (lock_file_list->fd >= 0)
>> -				close(lock_file_list->fd);
>> -			unlink_or_warn(lock_file_list->filename);
>> -		}
>> -		lock_file_list = lock_file_list->next;
>> +	while (p) {
>> +		if (p->owner == me &&
>> +		    p->filename[0]) {
>> +			if (p->fd >= 0)
>> +				close(p->fd);
>> +			unlink_or_warn(p->filename);
>> +		}
>> +		p = lock_file_list->next;
>> 	}
>
> Heh, shouldn't the last one assign from p->next?

Yes.  And I also should have mentioned: this is untested.
--
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]