Diffstat (limited to 'libopie2/opiecore/oprocess.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/oprocess.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiecore/oprocess.cpp b/libopie2/opiecore/oprocess.cpp index b3f9724..56f9883 100644 --- a/libopie2/opiecore/oprocess.cpp +++ b/libopie2/opiecore/oprocess.cpp | |||
@@ -919,25 +919,25 @@ bool OProcess::isExecutable( const QCString &filename ) | |||
919 | } | 919 | } |
920 | 920 | ||
921 | int OProcess::processPID( const QString& process ) | 921 | int OProcess::processPID( const QString& process ) |
922 | { | 922 | { |
923 | QString line; | 923 | QString line; |
924 | QDir d = QDir( "/proc" ); | 924 | QDir d = QDir( "/proc" ); |
925 | QStringList dirs = d.entryList( QDir::Dirs ); | 925 | QStringList dirs = d.entryList( QDir::Dirs ); |
926 | QStringList::Iterator it; | 926 | QStringList::Iterator it; |
927 | for ( it = dirs.begin(); it != dirs.end(); ++it ) | 927 | for ( it = dirs.begin(); it != dirs.end(); ++it ) |
928 | { | 928 | { |
929 | //qDebug( "next entry: %s", (const char*) *it ); | 929 | //qDebug( "next entry: %s", (const char*) *it ); |
930 | QFile file( "/proc/"+*it+"/cmdline" ); | 930 | QFile file( "/proc/"+*it+"/cmdline" ); |
931 | file.open( IO_ReadOnly ); | 931 | if ( !file.open( IO_ReadOnly ) ) continue; |
932 | if ( !file.isOpen() ) continue; | 932 | if ( !file.isOpen() ) continue; |
933 | QTextStream t( &file ); | 933 | QTextStream t( &file ); |
934 | line = t.readLine(); | 934 | line = t.readLine(); |
935 | //qDebug( "cmdline = %s", (const char*) line ); | 935 | //qDebug( "cmdline = %s", (const char*) line ); |
936 | if ( line.contains( process ) ) break; //FIXME: That may find also other process, if the name is not long enough ;) | 936 | if ( line.contains( process ) ) break; //FIXME: That may find also other process, if the name is not long enough ;) |
937 | } | 937 | } |
938 | if ( line.contains( process ) ) | 938 | if ( line.contains( process ) ) |
939 | { | 939 | { |
940 | //qDebug( "found process id #%d", (*it).toInt() ); | 940 | //qDebug( "found process id #%d", (*it).toInt() ); |
941 | return (*it).toInt(); | 941 | return (*it).toInt(); |
942 | } | 942 | } |
943 | else | 943 | else |