summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
213ca11)
Change-Id: I16f27d7627eee4328d92e6ed2d7db8e59e90f79d
Indicator::LockFile::~LockFile()
{
// Closing file descriptor also unlocks file.
Indicator::LockFile::~LockFile()
{
// Closing file descriptor also unlocks file.
- close( mFileDescriptor );
+ if( mFileDescriptor > 0 )
+ {
+ close( mFileDescriptor );
+ }
}
bool Indicator::LockFile::Lock()
}
bool Indicator::LockFile::Lock()
{
DALI_LOG_TRACE_METHOD( gIndicatorLogFilter );
{
DALI_LOG_TRACE_METHOD( gIndicatorLogFilter );
- struct flock filelock;
-
- filelock.l_type = F_UNLCK;
- filelock.l_whence = SEEK_SET;
- filelock.l_start = 0;
- filelock.l_len = 0;
- if (fcntl(mFileDescriptor, F_SETLKW, &filelock) == -1)
+ if( mFileDescriptor > 0 )
- mErrorThrown = true;
- DALI_LOG_ERROR( "### Failed to lock with fd : %s ###\n", mFilename.c_str() );
+ struct flock filelock;
+
+ filelock.l_type = F_UNLCK;
+ filelock.l_whence = SEEK_SET;
+ filelock.l_start = 0;
+ filelock.l_len = 0;
+ if (fcntl(mFileDescriptor, F_SETLKW, &filelock) == -1)
+ {
+ mErrorThrown = true;
+ DALI_LOG_ERROR( "### Failed to lock with fd : %s ###\n", mFilename.c_str() );
+ }
{
DALI_LOG_ERROR( "### Indicator error: Cannot open lock file %s ###\n", mSharedFileInfo[n].mLockFileName.c_str() );
}
{
DALI_LOG_ERROR( "### Indicator error: Cannot open lock file %s ###\n", mSharedFileInfo[n].mLockFileName.c_str() );
}
-
- CreateNewImage( n );
- UpdateVisibility();
+ else
+ {
+ CreateNewImage( n );
+ UpdateVisibility();
+ }
- DALI_LOG_WARNING("### Cannot create indicator image - disconnecting ###\n");
- Disconnect();
- if( mObserver != NULL )
- {
- mObserver->IndicatorClosed( this );
- }
- // Don't do connection in this callback - strange things happen!
- StartReconnectionTimer();
+ DALI_LOG_WARNING("### Cannot create indicator image ###\n");