svn rev #21978: tools/gssmonger/trunk/gssmaggot/
raeburn@MIT.EDU
raeburn at MIT.EDU
Thu Feb 12 12:31:37 EST 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=21978
Commit By: raeburn
Log Message:
pass correct maxfd to select on unix; when receiving 0-length string, allocate 1 byte instead of using NULL
Changed Files:
U tools/gssmonger/trunk/gssmaggot/netrw.c
U tools/gssmonger/trunk/gssmaggot/netutil.c
Modified: tools/gssmonger/trunk/gssmaggot/netrw.c
===================================================================
--- tools/gssmonger/trunk/gssmaggot/netrw.c 2009-02-12 17:30:51 UTC (rev 21977)
+++ tools/gssmonger/trunk/gssmaggot/netrw.c 2009-02-12 17:31:37 UTC (rev 21978)
@@ -487,7 +487,7 @@
FD_ZERO( &fds );
FD_SET( Sock, &fds );
- if ( !select( 0, /* first parameter is ignored for compatibility */
+ if ( !select( Sock+1,
&fds,
NULL,
NULL,
Modified: tools/gssmonger/trunk/gssmaggot/netutil.c
===================================================================
--- tools/gssmonger/trunk/gssmaggot/netutil.c 2009-02-12 17:30:51 UTC (rev 21977)
+++ tools/gssmonger/trunk/gssmaggot/netutil.c 2009-02-12 17:31:37 UTC (rev 21978)
@@ -357,13 +357,15 @@
} else {
- /* zero-length thingie sent. Set the pvData to null.
- THIS IS PROBABLY NOT WHAT YOU WANT. */
+ /* Zero-length thingie sent. Store an empty C string,
+ because later sometimes we try to compare or print it. */
- pEntries[ i ].pvData = NULL;
-
+ ret = MMALLOC( 1, &pEntries[ i ].pvData );
+ if (pEntries[ i ].pvData)
+ *(char *)pEntries[ i ].pvData = 0;
}
+
} else {
ASSERT( pEntries[ i ].pvData != NULL );
@@ -853,7 +855,7 @@
FD_SET( Socket, &fdsExcept );
}
- return select( 0, /* first parameter ignored for compatibility */
+ return select( Socket+1,
&fdsRead,
&fdsWrite,
&fdsExcept,
More information about the cvs-krb5
mailing list