diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2003-11-27 16:42:49 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2003-11-27 16:42:49 +0000 |
commit | 318e1cd9bb39e391d24cef8516a061a6b5f8d5b0 (patch) | |
tree | 1d00d255d314075d39bbd91c5f61f0407e51e1e4 /mdk-stage1 | |
parent | 28bd2f99f15a5cb9db62201b03d31338e2866af0 (diff) | |
download | drakx-backup-do-not-use-318e1cd9bb39e391d24cef8516a061a6b5f8d5b0.tar drakx-backup-do-not-use-318e1cd9bb39e391d24cef8516a061a6b5f8d5b0.tar.gz drakx-backup-do-not-use-318e1cd9bb39e391d24cef8516a061a6b5f8d5b0.tar.bz2 drakx-backup-do-not-use-318e1cd9bb39e391d24cef8516a061a6b5f8d5b0.tar.xz drakx-backup-do-not-use-318e1cd9bb39e391d24cef8516a061a6b5f8d5b0.zip |
don't eject cdrom in nfs
Diffstat (limited to 'mdk-stage1')
-rw-r--r-- | mdk-stage1/init.c | 17 |
1 files changed, 11 insertions, 6 deletions
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 |