Re: [PATCH] fio_sem, diskutil: introduce fio_shared_sem and use it for diskutil lock

Shinichiro Kawasaki <[email protected]>
Newsgroups org.kernel.vger.fio
Message-ID <d3fhqfmwtvhptpukazupnrhmialrekujjokuhoi7bdoxvzr5gk@yvnmyknsooxj>
On May 12, 2025 / 07:16, Jens Axboe wrote:
> On 5/11/25 7:30 PM, Shin'ichiro Kawasaki wrote:
...
> > +struct fio_sem *fio_shared_sem_init(int value)
> > +{
> > +	struct fio_sem *sem = NULL;
> 
> Pointless initialization, you overwrite it right after.
> 
> > +	sem = smalloc(sizeof(struct fio_sem));
> > +	if (!sem) {
> > +		perror("fio: smalloc for semaphore failed");
> > +		return NULL;
> > +	}
> 
> smalloc() doesn't set errno, and logs an error separately.

Thanks. I will reflect the comments and send out v2 soon.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.