Re: [PATCH v4 01/44] wrapper: implement xopen()

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

 



Torsten Bögershausen <tboegi@xxxxxx> writes:

>> +int xopen(const char *path, int oflag, ...)
>> +{
>> +	mode_t mode = 0;
>> +	va_list ap;
>> +
>> +	va_start(ap, oflag);
>> +	if (oflag & O_CREAT)
>> +		mode = va_arg(ap, mode_t);
>> +	va_end(ap);
>> +
>> +	assert(path);
>> +
> 2 remarks:
> - I don't know if and why we need the assert() here (but don't know if
> we have a strategie in Git for assert())

There is no bright-line rules, but I think it is sensible to remove
this.  Nobody sane would throw a NULL at open(2) and xopen() is
supposed to imitate that interface.  We do protect ourselves from
careless use of our own API, but no need to clutter the code with
overly zealous check against insane code, I would say.
--
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]