1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-31 07:51:08 +03:00

[PATCH] DEVNAME on device removal

I just noticed that the DEVNAME enviroment variable isn't being set anymore
  in udev 0.046 on device removal, while it was being set in 0.042. We're using
  the property tto do umount -l <devices> when a block device is removed. Afaik
  there is no other way to associate a device with it's DEVNAME on removal ?

  Also are there cases where doing umount -l on the removed devices is wrong?
  I guess the device is gone, so there is no sense in keeping it mounted (it's
  not like the filesystem is gonna come back in a sane state again)..

  Attached (trivial) patch brings back the DEVNAME variable on device removal.
This commit is contained in:
sjoerd@spring.luon.net 2004-11-23 07:49:55 -08:00 committed by Greg KH
parent 0d1ecb44a0
commit 67aca2c509

4
udev.c
View File

@ -192,6 +192,10 @@ int main(int argc, char *argv[], char *envp[])
/* get node from db, remove db-entry, delete created node */
retval = udev_remove_device(&udev);
/* Set the DEVNAME if known */
if (udev.devname[0] != '\0') {
setenv("DEVNAME", udev.devname, 1);
}
/* run dev.d/ scripts if we're not instructed to ignore the event */
if (udev.devname[0] != '\0') {
setenv("DEVNAME", udev.devname, 1);