[U-Boot] [PATCH] UBIFS: Improve error message when reading superblock failed

Bernhard Walle walle at corscience.de
Fri Feb 17 15:31:10 CET 2012


Hi Detlev,

* Detlev Zundel <dzu at denx.de> [2012-02-17 15:15]:
> 
> > @@ -1191,7 +1191,7 @@ int ubifs_mount(char *vol_name)
> >  	mnt = NULL;
> >  	ret = ubifs_get_sb(&ubifs_fs_type, flags, name, data, mnt);
> >  	if (ret) {
> > -		printf("Error reading superblock on volume '%s'!\n", name);
> > +		printf("Error reading superblock on volume '%s': %d!\n", name, -ret);
> >  		return -1;
> >  	}
> 
> I think this makes sense, but I think it would be more natural to print
> the real error code, not the negative value.  I don't know how to search
> for all such occurrences, but I cannot find any but a lot of sites
> printing the error code as is.

well, the return value is negative, so my intention was to print the
error code as positive number. So you think we should display it as
negative number (-12 instead of 12 for ENOMEM)?


Regards,
Bernhard


More information about the U-Boot mailing list