PATCH: files/smb.c -- portability

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

 



A struct sockaddr is simply not the same as a struct sockaddr_in, even
if they _start_ the same.

Tested on SuSE Linux 8.1 and FreeBSD 4.7 (where without this patch we
get warnings).

Gerald


ChangeLog:
Properly cast struct sockaddr_in* to struct sockaddr* where needed.

Index: smb.c
===================================================================
RCS file: /home/wine/wine/files/smb.c,v
retrieving revision 1.13
diff -u -3 -p -r1.13 smb.c
--- smb.c	21 Nov 2002 03:45:03 -0000	1.13
+++ smb.c	22 Jan 2003 22:04:26 -0000
@@ -236,7 +236,7 @@ static BOOL NB_Lookup(LPCSTR host, struc
     if(len<=0)
         goto err;

-    r = sendto(fd, buffer, len, 0, &sin, sizeof sin);
+    r = sendto(fd, buffer, len, 0, (struct sockaddr*)&sin, sizeof sin);
     if(r<0)
     {
         FIXME("Error sending packet\n");
@@ -257,7 +257,7 @@ static BOOL NB_Lookup(LPCSTR host, struc
     TRACE("Got response!\n");

     fromsize = sizeof (fromaddr);
-    r = recvfrom(fd, buffer, sizeof buffer, 0, &fromaddr, &fromsize);
+    r = recvfrom(fd, buffer, sizeof buffer, 0, (struct sockaddr*)&fromaddr, &fromsize);
     if(r<0)
         goto err;

@@ -1327,7 +1327,7 @@ connect:
         unsigned char *x = (unsigned char *)&sin.sin_addr;
         TRACE("Connecting to %d.%d.%d.%d ...\n", x[0],x[1],x[2],x[3]);
     }
-    r = connect(fd, &sin, sizeof sin);
+    r = connect(fd, (struct sockaddr*)&sin, sizeof sin);

     if(!NB_SessionReq(fd, "*SMBSERVER", "WINE"))
     {


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux