Change 31428 by [EMAIL PROTECTED] on 2007/06/20 16:03:10

        Change #31426 should also be applied to the PERL_IMPLICIT_SYS
        version of ioctl()

Affected files ...

... //depot/perl/win32/perlhost.h#70 edit

Differences ...

==== //depot/perl/win32/perlhost.h#70 (text) ====
Index: perl/win32/perlhost.h
--- perl/win32/perlhost.h#69~29675~     2007-01-03 09:56:16.000000000 -0800
+++ perl/win32/perlhost.h       2007-06-20 09:03:10.000000000 -0700
@@ -989,7 +989,14 @@
 int
 PerlLIOIOCtl(struct IPerlLIO* piPerl, int i, unsigned int u, char *data)
 {
-    return win32_ioctlsocket((SOCKET)i, (long)u, (u_long*)data);
+    u_long u_long_arg;
+    int retval;
+
+    /* mauke says using memcpy avoids alignment issues */
+    memcpy(&u_long_arg, data, sizeof u_long_arg); 
+    retval = win32_ioctlsocket((SOCKET)i, (long)u, &u_long_arg);
+    memcpy(data, &u_long_arg, sizeof u_long_arg);
+    return retval;
 }
 
 int
End of Patch.

Reply via email to