File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
drm/libdrmframework/plugins/forward-lock/internal-format/decoder Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1414 * limitations under the License.
1515 */
1616
17+ #include <utils/Log.h>
1718#include <assert.h>
1819#include <errno.h>
1920#include <fcntl.h>
@@ -107,6 +108,7 @@ static int FwdLockFile_AcquireSession(int fileDesc) {
107108 }
108109 pthread_mutex_unlock (& sessionAcquisitionMutex );
109110 if (i == MAX_NUM_SESSIONS ) {
111+ ALOGE ("Too many sessions opened at the same time" );
110112 errno = ENFILE ;
111113 }
112114 }
@@ -293,7 +295,12 @@ int FwdLockFile_attach(int fileDesc) {
293295
294296int FwdLockFile_open (const char * pFilename ) {
295297 int fileDesc = open (pFilename , O_RDONLY );
296- if (fileDesc >= 0 && FwdLockFile_attach (fileDesc ) < 0 ) {
298+ if (fileDesc < 0 ) {
299+ ALOGE ("failed to open file '%s': %s" , pFilename , strerror (errno ));
300+ return fileDesc ;
301+ }
302+
303+ if (FwdLockFile_attach (fileDesc ) < 0 ) {
297304 (void )close (fileDesc );
298305 fileDesc = -1 ;
299306 }
You can’t perform that action at this time.
0 commit comments