Fix traffic analyzer developer build

Holger Hetterich hhetter at novell.com
Mon Mar 22 08:27:09 MDT 2010


Am Freitag, 19. März 2010 22:55:36 schrieb Jeremy Allison:
> On Fri, Mar 19, 2010 at 03:00:09PM +0100, Holger Hetterich wrote:
> > Hi Jeremy, thank you for looking at this!
> > 
> > With the argumentation used above, I could cast almost all
> > ints in the asprintf format, because most of the values will
> > never be negative. However it was my original intention to not
> > have to cast all the values inside the asprintf format. :)
> 
> I prefer to keep variables as abstract types, and cast them
> when being used in an asprintf-type function.
> 
> > Also, nearly none of the values will ever  be in the range where
> > unsigned/signed does matter. The only exception I see is theoretically
> > the write/pwrite/read/pread call, that returns a size_t as the
> > number of bytes that have been transferred. And even there
> > it's unlikely I'll hit the borders.
> > 
> > So in this patch, I am using a size_t for write,read,pread,pwrite,
> > and cast it to unsigned int.
> 
> The way I've been thinking about this in Samba
> has changed over the years. Here's what I do now:

Hi Jeremy, thanks for your comments, I do understand
the reasoning.

In this new patch, I keep any data types as is, and just
cast them right in the asprintf, or - when it's immediately
needed.

Like the patch before, it reenables the rmdir function, as it
was missing in the function pointer table.

Additionally, this patch adds copying the mode_t parameter
into the corresponding data structure for the smb_traffic_analyzer_open
function, this was forgotten.

Holger
-- 
Holger Hetterich, hhetter at novell.com, 
  SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
   Maxfeldstr. 5, 90409 Nürnberg, Germany
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-vfs_smb_traffic_analyzer.c-remove-warnings-from-d.patch
Type: text/x-patch
Size: 4693 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100322/b16eebeb/attachment.bin>


More information about the samba-technical mailing list