summaryrefslogtreecommitdiff
path: root/noncore/applets/memoryapplet/swapfile.cpp
authormickeyl <mickeyl>2005-04-24 05:48:32 (UTC)
committer mickeyl <mickeyl>2005-04-24 05:48:32 (UTC)
commitceaea9869115287b48781fabc938bd51cb67625c (patch) (unidiff)
tree4590e122439ac35ded56cad8b22f327d73e72844 /noncore/applets/memoryapplet/swapfile.cpp
parent07f375f59f19a001685db1b78e9ba9040c73bbeb (diff)
downloadopie-ceaea9869115287b48781fabc938bd51cb67625c.zip
opie-ceaea9869115287b48781fabc938bd51cb67625c.tar.gz
opie-ceaea9869115287b48781fabc938bd51cb67625c.tar.bz2
fix crash on kernels without swap support. patch courtesy Seneca Cunningham
Diffstat (limited to 'noncore/applets/memoryapplet/swapfile.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/memoryapplet/swapfile.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/noncore/applets/memoryapplet/swapfile.cpp b/noncore/applets/memoryapplet/swapfile.cpp
index 4609c13..50c173b 100644
--- a/noncore/applets/memoryapplet/swapfile.cpp
+++ b/noncore/applets/memoryapplet/swapfile.cpp
@@ -1,7 +1,8 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** Copyright (C) 2002-2005 the Opie Team <opie-devel@handhelds.org>
3** 4**
4** This file is part of Qtopia Environment. 5** This file is part of Opie Environment.
5** 6**
6** This file may be distributed and/or modified under the terms of the 7** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 8** GNU General Public License version 2 as published by the Free Software
@@ -56,6 +57,11 @@ using namespace Opie::Core;
56Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) 57Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f )
57 : QWidget( parent, name, f ) 58 : QWidget( parent, name, f )
58{ 59{
60 if ( !QFile::exists( "/proc/swaps" ) )
61 {
62 QLabel *text = new QLabel( tr( "Swap disabled in kernel" ), this );
63 return;
64 }
59 // are we running as root? 65 // are we running as root?
60 isRoot = geteuid() == 0; 66 isRoot = geteuid() == 0;
61 67