Re: [PATCH] lscpu: Fix regression caused by WSL detection

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

 



On Tue, Jan 31, 2017 at 06:38:39PM +0100, Stanislav Brabec wrote:
> Stanislav Brabec wrote:
> > Commit 7572fb2b8cb69512ca230b7fcfa11577526843f4 introduced a failure on missing
> > /proc/sys/kernel/osrelease. Make it non-fatal to prevent crash in some chroot
> > environments.
> > 
> >  	if (path_exist(_PATH_PROC_OSRELEASE)
> > -	    && (fd = path_fopen("r", 1, _PATH_PROC_OSRELEASE))) {
> > +	    && (fd = path_fopen("r", 0, _PATH_PROC_OSRELEASE))) {
> 
> It was my fault. I did not sent a patch with path_exist(_PATH_PROC_OSRELEASE) as
> 7572fb2b8cb69512ca230b7fcfa11577526843f4. It was my old version.
> 
> Use of 0 in path_fopen() seems to be a better solution that path_exist().

Yes, I have found the problem and added path_exist() like we use on
another places in the code, but you're right that path_fopen("r", 0,
...) is more elegant solution.

Fixed and path_exist() before path_fopen() removed from the another
places too.

Thanks!

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux