summaryrefslogtreecommitdiffstats
path: root/drm
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2012-03-09 16:11:18 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-09 16:11:18 -0800
commitd64f3a376536a993fe6d81730b8b7b738500435e (patch)
tree19aea3b37ce1c690fcd7964c27ff66458c6188e7 /drm
parent18868c5db2f90309c6d11e5837822135e4a0c0fa (diff)
parent9c78e8681dafcdf265bc733875bad436ef9ec220 (diff)
downloadframeworks_av-d64f3a376536a993fe6d81730b8b7b738500435e.zip
frameworks_av-d64f3a376536a993fe6d81730b8b7b738500435e.tar.gz
frameworks_av-d64f3a376536a993fe6d81730b8b7b738500435e.tar.bz2
Merge "Added an failure log message when the fwdlock engine fails to open a given file."
Diffstat (limited to 'drm')
-rw-r--r--drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c b/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c
index dacf00e..365bdec 100644
--- a/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c
+++ b/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <utils/Log.h>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
@@ -107,6 +108,7 @@ static int FwdLockFile_AcquireSession(int fileDesc) {
}
pthread_mutex_unlock(&sessionAcquisitionMutex);
if (i == MAX_NUM_SESSIONS) {
+ ALOGE("Too many sessions opened at the same time");
errno = ENFILE;
}
}
@@ -293,7 +295,12 @@ int FwdLockFile_attach(int fileDesc) {
int FwdLockFile_open(const char *pFilename) {
int fileDesc = open(pFilename, O_RDONLY);
- if (fileDesc >= 0 && FwdLockFile_attach(fileDesc) < 0) {
+ if (fileDesc < 0) {
+ ALOGE("failed to open file '%s': %s", pFilename, strerror(errno));
+ return fileDesc;
+ }
+
+ if (FwdLockFile_attach(fileDesc) < 0) {
(void)close(fileDesc);
fileDesc = -1;
}