shithub: sl

Download patch

ref: 5a7e2491675df97bde089b057a255be3093054d8
parent: 9645b04499cba95df390c2fc2dc2a6a999e8474c
author: spew <spew@cbza.org>
date: Fri Mar 14 13:46:31 EDT 2025

lsd: status, use read-all

--- a/src/plan9/lsd.lsp
+++ b/src/plan9/lsd.lsp
@@ -127,12 +127,10 @@
   (if (>= pid 0) (attach)))
 
 (def (status)
-  (let ((sf (procfile 'status)))
-    (read sf)
-    (read sf)
-    (let ((stat (read sf)))
-      (io-close sf)
-      stat)))
+  (let* ((sf (procfile 'status))
+         (stats (read-all sf)))
+    (io-close sf)
+    (caddr stats)))
 
 (def tracers (table
   "amd64" (λ () (lsd-ctrace (readreg PC) (readreg SP) (u64 0)))