Rev 4075 | Rev 4505 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4075 | Rev 4192 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | * This file has to be compiled with both the packet server and the client. |
35 | * This file has to be compiled with both the packet server and the client. |
36 | */ |
36 | */ |
37 | 37 | ||
38 | #include <errno.h> |
38 | #include <errno.h> |
39 | #include <malloc.h> |
39 | #include <malloc.h> |
- | 40 | #include <mem.h> |
|
40 | #include <rwlock.h> |
41 | #include <rwlock.h> |
41 | //#include <stdio.h> |
42 | //#include <stdio.h> |
42 | #include <string.h> |
- | |
43 | 43 | ||
44 | #include <sys/mman.h> |
44 | #include <sys/mman.h> |
45 | 45 | ||
46 | #include "../../err.h" |
46 | #include "../../err.h" |
47 | 47 | ||
Line 146... | Line 146... | ||
146 | map = ( packet_map_ref ) malloc( sizeof( packet_map_t )); |
146 | map = ( packet_map_ref ) malloc( sizeof( packet_map_t )); |
147 | if( ! map ){ |
147 | if( ! map ){ |
148 | rwlock_write_unlock( & pm_globals.lock ); |
148 | rwlock_write_unlock( & pm_globals.lock ); |
149 | return ENOMEM; |
149 | return ENOMEM; |
150 | } |
150 | } |
151 | memset( map, 0, sizeof( packet_map_t )); |
151 | bzero( map, sizeof( packet_map_t )); |
152 | if(( ERROR_CODE = gpm_add( & pm_globals.packet_map, map )) < 0 ){ |
152 | if(( ERROR_CODE = gpm_add( & pm_globals.packet_map, map )) < 0 ){ |
153 | rwlock_write_unlock( & pm_globals.lock ); |
153 | rwlock_write_unlock( & pm_globals.lock ); |
154 | free( map ); |
154 | free( map ); |
155 | return ERROR_CODE; |
155 | return ERROR_CODE; |
156 | } |
156 | } |