Re: [PATCH] multipath-tools (coverity): assert availability of CLOCK_MONOTONIC

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

 



On Mon, 2019-05-20 at 22:09 +0200, Bart Van Assche wrote:
> On 5/20/19 6:30 PM, Martin Wilck wrote:
> > +void get_monotonic_time(struct timespec *res)
> > +{
> > +	struct timespec ts;
> > +
> > +	assert(clock_gettime(CLOCK_MONOTONIC, &ts) == 0);
> > +	*res = ts;
> > +}
> 
> This is an example of bad coding style because the clock_gettime()
> call
> will be skipped if anyone would compile this code with -DNDEBUG.

I'd rather call it an example of me being ignorant ...
Thanks a lot for pointing it out.

Martin


--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux