summaryrefslogtreecommitdiff
path: root/watchForNewDrives.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-08-17 17:02:29 -0500
committerJeff Carr <[email protected]>2025-08-17 22:57:06 -0500
commit25c604aeee7cd821d27dfd4c09bf0626e9312535 (patch)
treee7b875d4077ffb7fa265c7a1bd8fefafbc9d0235 /watchForNewDrives.go
parentbd5b16d8755bc9e5f0dc90162bc4724d319c725e (diff)
protobuf file for block devices
Diffstat (limited to 'watchForNewDrives.go')
-rw-r--r--watchForNewDrives.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/watchForNewDrives.go b/watchForNewDrives.go
index 3f50707..bf92721 100644
--- a/watchForNewDrives.go
+++ b/watchForNewDrives.go
@@ -44,7 +44,9 @@ func listenForBlockEvents() {
msg := parseUevent(buf[:n])
if msg["SUBSYSTEM"] == "block" && msg["ACTION"] == "add" {
log.Printf("New block device added: %s\n", msg["DEVNAME"])
- me.dd.AddText("/dev/" + msg["DEVNAME"] + " new")
+ devname := "/dev/" + msg["DEVNAME"]
+ me.dd.AddText(devname + " new")
+ me.pb.InsertByName(devname)
}
log.Printf("New syscall.NETLINK_KOBJECT_UEVENT: %v\n", msg)
}