// remove backup
if ( myBFile )
fclose( myBFile );
+
+#ifndef WIN32
+ if ( myBFileFcntl )
+ fclose( myBFileFcntl );
+#endif
+
if ( !myBFolder.isEmpty() )
Qtx::rmDir( myBFolder );
if ( theLF.isEmpty() )
aFD = myBFileFcntl;
else
+ {
aFD = fopen( theLF.toLatin1().constData(), "w" );
+ if ( !aFD )
+ return -1;
+ }
struct flock fLock;
fLock.l_type = F_WRLCK;
fLock.l_whence = SEEK_SET;
fLock.l_len = 0;
fLock.l_start = 0;
- return fcntl( fileno( aFD ), F_SETLK, &fLock );
+
+ int ret = fcntl( fileno( aFD ), F_SETLK, &fLock );
+ return ret;
}
#endif
if ( !QFileInfo( blocName ).exists() || !locked )
{
// unused non-removed folder
+#ifdef WIN32
Qtx::rmDir( currF );
+#else
+ // use the system call Qtx::rmDir() may not work on Linux
+ QString cmd = QString( "rm -rf " ) + currF.toLatin1().constData();
+ system( cmd.toLatin1().constData() );
+#endif
}
}
}