commit 04b068f7a39527eaadb262374c7fcdc8ef4cb61d
parent 53f57c1a8c86dbc16414fe86b55f2ef48988f3d0
Author: Daniel Barlow <dan@telent.net>
Date: Sat, 1 Jun 2024 22:43:48 +0100
delete unused code
Diffstat:
2 files changed, 1 insertion(+), 46 deletions(-)
diff --git a/pkgs/devout/devout.fnl b/pkgs/devout/devout.fnl
@@ -170,7 +170,6 @@
AF_NETLINK 0 0 groups)))
(nil errno) (values nil errno)))
-
(fn event-loop []
(let [fds {}]
{
@@ -184,19 +183,6 @@
:_tbl #(do fds) ;exposed for tests
}))
-
-
-(fn sysfs [fspath]
- {
- :attr (fn [_ path name]
- (read-if-exists (.. fspath "/" path "/" name)))
- :attrs (fn [self path name]
- (when path
- (or (self:attr path name)
- (self:attrs (dirname path) name))))
- })
-
-
(fn run []
(let [[sockname nl-groups] arg
s (check-errno (unix-socket sockname))
@@ -222,4 +208,4 @@
(ll.poll pollfds 5000)
(loop:feed (unpack-pollfds pollfds))))))
-{ : database : run : event-loop : parse-event : sysfs }
+{ : database : run : event-loop : parse-event }
diff --git a/pkgs/devout/test.fnl b/pkgs/devout/test.fnl
@@ -246,35 +246,4 @@ MINOR=17")
))
-;; tests for sysfs attrs
-
-(example
- "read attributes from sysfs"
- (let [sysfs (sysfs "./fixtures/sys")]
- ;; finds attr at path
- (expect=
- (sysfs:attr "devices/pci0000:00/0000:00:14.0/usb1/1-2" "idVendor")
- "1199")
- ;; finds attr in ancestor directory
- (expect=
- (sysfs:attrs
- "devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/bluetooth/hci0"
- "idVendor")
- "8087")
- ;; nil if no attr
- (expect=
- (sysfs:attrs
- "devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/bluetooth/hci0"
- "idOfWizard")
- nil)
- ;; closer ancestor wins against more distant one
- (expect=
- (sysfs:attrs
- "devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/bluetooth/hci0"
- "modalias")
- "usb:v8087p0A2Bd0001dcE0dsc01dp01icE0isc01ip01in00")))
-
-
-
-
(if failed (os.exit 1) (print "OK"))