summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Plugins/Monitors/Net
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2024-03-30 18:26:01 +0000
committerjao <jao@gnu.org>2024-03-30 18:26:01 +0000
commit30d226ba5eca8847775d03403367dee1f1e3dcfc (patch)
treeb62d0f7f176f9f2b58d66866c3c6afb581334bd6 /src/Xmobar/Plugins/Monitors/Net
parent3f4ae1034fe7575df05c59dd0c357fd448198594 (diff)
downloadxmobar-30d226ba5eca8847775d03403367dee1f1e3dcfc.tar.gz
xmobar-30d226ba5eca8847775d03403367dee1f1e3dcfc.tar.bz2
fix for unmet pattern matches warnings (clean build)
Diffstat (limited to 'src/Xmobar/Plugins/Monitors/Net')
-rw-r--r--src/Xmobar/Plugins/Monitors/Net/Linux.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Xmobar/Plugins/Monitors/Net/Linux.hs b/src/Xmobar/Plugins/Monitors/Net/Linux.hs
index 9306497..f9cbc28 100644
--- a/src/Xmobar/Plugins/Monitors/Net/Linux.hs
+++ b/src/Xmobar/Plugins/Monitors/Net/Linux.hs
@@ -47,7 +47,10 @@ isUp d = flip catchIOError (const $ return False) $ do
return $! (head . B.lines) operstate `elem` ["up", "unknown"]
readNetDev :: [String] -> IO NetDevRawTotal
-readNetDev ~[d, x, y] = do
+readNetDev ds = do
+ let (d, x, y) = case ds of
+ d':x':y':_ -> (d', x', y')
+ _ -> ("", "", "")
up <- unsafeInterleaveIO $ isUp d
return $ N d (if up then ND (r x) (r y) else NI)
where r s | s == "" = 0