* net.cc (free_char_list): Delete.
(dup_addr_list): Delete.
(dup_char_list): Delete.
(free_hostent_ptr): Delete.
(free_protoent_ptr): Delete.
(free_servent_ptr): Delete.
(DWORD_round): New function.
(strlen_round): New function.  Returns strlen rounded up to word size.
(dup_ent): New, generic function to duplicate a {host,proto,serv}ent structure.
(gen_ent): New macro.  Generates a generic dup_{host,proto,serv}ent_ptr
function.
(cygwin_getservbyname): Remove call to free_servent_ptr, pass servent_buf to
dup_servent_ptr.
(cygwin_getservbyport): Ditto.
(cygwin_gethostbyname): Ditto for hostent.
(cygwin_gethostbyaddr): Ditto.
(cygwin_getprotobyname): Ditto for protoent.
(cygwin_getprotobynumber): Ditto.
			
			
This commit is contained in:
		@@ -139,7 +139,6 @@ sbrk (int n)
 | 
			
		||||
  /* Couldn't allocate memory.  Maybe we can reserve some more.
 | 
			
		||||
     Reserve either the maximum of the standard cygwin_shared->heap_chunk_size ()
 | 
			
		||||
     or the requested amount.  Then attempt to actually allocate it.  */
 | 
			
		||||
 | 
			
		||||
  if ((newbrksize = cygheap->user_heap.chunk) < commitbytes)
 | 
			
		||||
    newbrksize = commitbytes;
 | 
			
		||||
 | 
			
		||||
@@ -147,7 +146,7 @@ sbrk (int n)
 | 
			
		||||
        || VirtualAlloc (cygheap->user_heap.top, newbrksize = commitbytes, MEM_RESERVE, PAGE_NOACCESS))
 | 
			
		||||
       && VirtualAlloc (cygheap->user_heap.top, commitbytes, MEM_COMMIT, PAGE_READWRITE) != NULL)
 | 
			
		||||
     {
 | 
			
		||||
	(char *) cygheap->user_heap.max += newbrksize;
 | 
			
		||||
	(char *) cygheap->user_heap.max += pround (newbrksize);
 | 
			
		||||
	goto good;
 | 
			
		||||
     }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user