Skip to content

Commit 1210d35

Browse files
committedJan 2, 2012
fix #4736
1 parent d28add9 commit 1210d35

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed
 

‎src/providers/grass/qgsgrass.cpp

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -453,31 +453,13 @@ QString GRASS_LIB_EXPORT QgsGrass::openMapset( QString gisdbase, QString locatio
453453
return QObject::tr( "%1 is not a GRASS mapset." ).arg( mapsetPath );
454454
}
455455

456+
#ifndef Q_OS_WIN
456457
QString lock = mapsetPath + "/.gislock";
457458
QFile lockFile( lock );
458-
#if WIN32
459-
// lock on Windows doesn't support locking (see #808)
460-
if ( lockFile.exists() )
461-
return QObject::tr( "Mapset is already in use." );
462-
463-
lockFile.open( QIODevice::WriteOnly );
464-
#ifndef _MSC_VER
465-
int pid = getpid();
466-
#else
467-
int pid = GetCurrentProcessId();
468-
#endif
469-
lockFile.write( QString( "%1" ).arg( pid ).toUtf8() );
470-
lockFile.close();
471-
#else
472459
QProcess *process = new QProcess();
473460
QString lockProgram( gisBase + "/etc/lock" );
474461

475-
// TODO: getpid() probably is not portable
476-
#ifndef _MSC_VER
477462
int pid = getpid();
478-
#else
479-
int pid = GetCurrentProcessId();
480-
#endif
481463
QgsDebugMsg( QString( "pid = %1" ).arg( pid ) );
482464

483465
process->start( lockProgram, QStringList() << lock << QString::number( pid ) );

0 commit comments

Comments
 (0)
Please sign in to comment.