Changeset 1315:177636363c47 in roaraudio for libroar
- Timestamp:
- 03/21/09 01:48:04 (15 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- libroar
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/basic.c
r1099 r1315 153 153 154 154 int roar_connect (struct roar_connection * con, char * server) { 155 roar_errno = ROAR_ERROR_UNKNOWN; 156 con->fh = roar_connect_raw(server); 157 158 if ( con->fh == -1 ) 159 return -1; 155 int fh; 156 157 if ( con == NULL ) { 158 roar_errno = ROAR_ERROR_INVAL; 159 return -1; 160 } 161 162 roar_errno = ROAR_ERROR_UNKNOWN; 163 fh = roar_connect_raw(server); 164 165 if ( fh == -1 ) 166 return -1; 167 168 return roar_connect_fh(con, fh); 169 } 170 171 int roar_connect_fh (struct roar_connection * con, int fh) { 172 173 if ( con == NULL || fh == -1 ) { 174 roar_errno = ROAR_ERROR_INVAL; 175 return -1; 176 } 177 178 // specal hack to set an ilegal value used internaly in libroar: 179 if ( fh == -2 ) 180 fh = -1; 181 182 memset(con, 0, sizeof(struct roar_connection)); 183 184 con->fh = fh; 160 185 161 186 roar_errno = ROAR_ERROR_NONE; 162 163 187 return 0; 164 188 } -
libroar/file.c
r1196 r1315 273 273 274 274 if ( exec ) { 275 con->fh = -1; 275 // TODO: FIXME: this ma cause a memory leak in future 276 // OLD: con->fh = -1; 277 roar_connect_fh(con, -2); 276 278 } 277 279
Note: See TracChangeset
for help on using the changeset viewer.