summaryrefslogtreecommitdiff
path: root/libopie2
authormickeyl <mickeyl>2004-02-15 18:22:15 (UTC)
committer mickeyl <mickeyl>2004-02-15 18:22:15 (UTC)
commit842923f72761677ea132c16a23091c5ee3a35780 (patch) (unidiff)
tree0b2995c8f4d87b7f6570d551c71f5c3aa4307f24 /libopie2
parent4d467f290f7f42717be14bb0f269570fe5dd07bc (diff)
downloadopie-842923f72761677ea132c16a23091c5ee3a35780.zip
opie-842923f72761677ea132c16a23091c5ee3a35780.tar.gz
opie-842923f72761677ea132c16a23091c5ee3a35780.tar.bz2
better return 0 here
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/oprocess.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiecore/oprocess.cpp b/libopie2/opiecore/oprocess.cpp
index 5cfcf32..83677aa 100644
--- a/libopie2/opiecore/oprocess.cpp
+++ b/libopie2/opiecore/oprocess.cpp
@@ -919,27 +919,27 @@ int OProcess::processPID( const QString& process )
919{ 919{
920 QString line; 920 QString line;
921 QDir d = QDir( "/proc" ); 921 QDir d = QDir( "/proc" );
922 QStringList dirs = d.entryList( QDir::Dirs ); 922 QStringList dirs = d.entryList( QDir::Dirs );
923 QStringList::Iterator it; 923 QStringList::Iterator it;
924 for ( it = dirs.begin(); it != dirs.end(); ++it ) 924 for ( it = dirs.begin(); it != dirs.end(); ++it )
925 { 925 {
926 //qDebug( "next entry: %s", (const char*) *it ); 926 //qDebug( "next entry: %s", (const char*) *it );
927 QFile file( "/proc/"+*it+"/cmdline" ); 927 QFile file( "/proc/"+*it+"/cmdline" );
928 file.open( IO_ReadOnly ); 928 file.open( IO_ReadOnly );
929 if ( !file.isOpen() ) continue; 929 if ( !file.isOpen() ) continue;
930 QTextStream t( &file ); 930 QTextStream t( &file );
931 line = t.readLine(); 931 line = t.readLine();
932 //qDebug( "cmdline = %s", (const char*) line ); 932 //qDebug( "cmdline = %s", (const char*) line );
933 if ( line.contains( process ) ) break; //FIXME: That may find also other process, if the name is not long enough ;) 933 if ( line.contains( process ) ) break; //FIXME: That may find also other process, if the name is not long enough ;)
934 } 934 }
935 if ( line.contains( process ) ) 935 if ( line.contains( process ) )
936 { 936 {
937 //qDebug( "found process id #%d", (*it).toInt() ); 937 //qDebug( "found process id #%d", (*it).toInt() );
938 return (*it).toInt(); 938 return (*it).toInt();
939 } 939 }
940 else 940 else
941 { 941 {
942 //qDebug( "process '%s' not found", (const char*) process ); 942 //qDebug( "process '%s' not found", (const char*) process );
943 return -1; 943 return 0;
944 } 944 }
945} 945}