From 318e1cd9bb39e391d24cef8516a061a6b5f8d5b0 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 27 Nov 2003 16:42:49 +0000 Subject: don't eject cdrom in nfs --- mdk-stage1/init.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'mdk-stage1') diff --git a/mdk-stage1/init.c b/mdk-stage1/init.c index 77305a5ec..f05ff62e5 100644 --- a/mdk-stage1/init.c +++ b/mdk-stage1/init.c @@ -271,7 +271,8 @@ void unmount_filesystems(void) struct filesystem fs[500]; int numfs = 0; int i, nb; - + int disallow_eject = 0; + printf("unmounting filesystems...\n"); fd = open("/proc/mounts", O_RDONLY, 0); @@ -300,6 +301,8 @@ void unmount_filesystems(void) *p++ = '\0'; while (*p != '\n') p++; p++; + if (!strcmp(fs[numfs].fs, "nfs")) + disallow_eject = 1; if (strcmp(fs[numfs].name, "/") && strcmp(fs[numfs].name, "/dev") && strncmp(fs[numfs].name, "/proc", 5)) @@ -332,11 +335,13 @@ void unmount_filesystems(void) } #ifdef MANDRAKE_MOVE - fd = open("/dev/cdrom", O_RDONLY|O_NONBLOCK, 0); - if (fd > 0) { - printf("ejecting cdrom...\n"); - ioctl(fd, CDROMEJECT, 0); - close(fd); + if (!disallow_eject) { + fd = open("/dev/cdrom", O_RDONLY|O_NONBLOCK, 0); + if (fd > 0) { + printf("ejecting cdrom...\n"); + ioctl(fd, CDROMEJECT, 0); + close(fd); + } } #endif -- cgit v1.2.1