Merge remote-tracking branch 'ArrayBolt3/arraybolt3/emerg-shutdown'

This commit is contained in:
Patrick Schleizer 2025-08-10 02:25:48 -04:00
commit 3629f2c3a5
No known key found for this signature in database
GPG key ID: CB8D50BB77BB3C48

View file

@ -793,6 +793,7 @@ void hw_monitor(int argc, char **argv) {
char *tmpbuf = NULL;
bool device_removed = false;
bool device_changed = false;
bool disk_media_changed = false;
len = recvmsg(ns, &msg, 0);
if (len == -1) {
@ -821,6 +822,10 @@ void hw_monitor(int argc, char **argv) {
device_changed = true;
goto next_str;
}
if (strcmp(tmpbuf, "DISK_MEDIA_CHANGE=1") == 0) {
disk_media_changed = true;
goto next_str;
}
if (strncmp(tmpbuf, "DEVNAME=", strlen("DEVNAME=")) == 0) {
if (device_removed || device_changed) {
@ -861,6 +866,11 @@ void hw_monitor(int argc, char **argv) {
goto next_str;
}
if (device_changed && !disk_media_changed) {
free(rem_devname_line);
goto next_str;
}
if (paranoid_mode) {
/* Something was removed, we don't care what, shut down now */
kill_system();