Show
Ignore:
Timestamp:
01/06/08 09:30:37 (11 months ago)
Author:
aknudsen
Message:

OSS: Don't stat before trying to open device

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • portaudio/branches/v19-devel/src/hostapi/oss/pa_unix_oss.c

    r1307 r1310  
    333333        else 
    334334        { 
    335             PA_DEBUG(( "%s: Can't access device: %s\n", __FUNCTION__, strerror( errno ) )); 
     335            /* Ignore ENOENT, which means we've tried a non-existent device */ 
     336            if( errno != ENOENT ) 
     337            { 
     338                PA_DEBUG(( "%s: Can't access device %s: %s\n", __FUNCTION__, deviceName, strerror( errno ) )); 
     339            } 
    336340        } 
    337341 
     
    516520       PaDeviceInfo *deviceInfo; 
    517521       int testResult; 
    518        struct stat stbuf; 
    519522 
    520523       if( i == 0 ) 
     
    523526          snprintf(deviceName, sizeof (deviceName), "%s%d", DEVICE_NAME_BASE, i); 
    524527 
    525        /* PA_DEBUG(("PaOSS BuildDeviceList: trying device %s\n", deviceName )); */ 
    526        if( stat( deviceName, &stbuf ) < 0 ) 
    527        { 
    528            if( ENOENT != errno ) 
    529                PA_DEBUG(( "%s: Error stat'ing %s: %s\n", __FUNCTION__, deviceName, strerror( errno ) )); 
    530            continue; 
    531        } 
     528       /* PA_DEBUG(("%s: trying device %s\n", __FUNCTION__, deviceName )); */ 
    532529       if( (testResult = QueryDevice( deviceName, ossApi, &deviceInfo )) != paNoError ) 
    533530       {