smb_read_error

Andrew Bartlett abartlet at pcug.org.au
Sun Feb 17 13:34:02 GMT 2002


Martin Pool wrote:
> 
> I thought I would take a quick look at where smb_read_error is used in
> Samba, after the recent confusion about when errors should be assigned
> to it.

Global Variables Suck. :-)

> This global is used from quite a few different places in Samba.  This
> graph shows the nontrivial references:
> 
>  http://samba.org/~mbp/readerror.ps
>  http://samba.org/~mbp/readerror.gif
> 
> Broadly, it seems to mean "what went wrong while reading the last
> request", but it's not quite that simple.  I wonder if it might not
> make the code more robust against future changes if we would do better
> to get rid of it and just use return codes to indicate errors instead.
> After a bit of study it looks like that would work reasonably in every
> case in which it's called.
> 
> Does that sound like a good idea?

I'm all for it.

-- 
Andrew Bartlett                                 abartlet at pcug.org.au
Manager, Authentication Subsystems, Samba Team  abartlet at samba.org
Student Network Administrator, Hawker College   abartlet at hawkerc.net
http://samba.org     http://build.samba.org     http://hawkerc.net




More information about the samba-technical mailing list