FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 06-21-2011, 03:17 PM
Martin Sivak
 
Default Show a message when ejecting media after test (#656378)

---
loader/cdinstall.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/loader/cdinstall.c b/loader/cdinstall.c
index e5d8d51..8de91df 100644
--- a/loader/cdinstall.c
+++ b/loader/cdinstall.c
@@ -64,19 +64,22 @@
extern uint64_t flags;

/* ejects the CD device the device node points at */
-static void ejectCdrom(char *device) {
+static int ejectCdrom(char *device) {
int ejectfd;

- if (!device) return;
+ if (!device) return 1;
logMessage(INFO, "ejecting %s...",device);
if ((ejectfd = open(device, O_RDONLY | O_NONBLOCK, 0)) >= 0) {
ioctl(ejectfd, CDROM_LOCKDOOR, 0);
if (ioctl(ejectfd, CDROMEJECT, 0))
logMessage(ERROR, "eject failed on device %s: %m", device);
close(ejectfd);
+ return 0;
} else {
logMessage(ERROR, "could not open device %s: %m", device);
}
+
+ return 1;
}

static char *cdrom_drive_status(int rc) {
@@ -201,8 +204,14 @@ static void mediaCheckCdrom(char *cddriver) {
free(descr);
}

- if (!FL_NOEJECT(flags))
- ejectCdrom(cddriver);
+ if (!FL_NOEJECT(flags)) {
+ if(!ejectCdrom(cddriver))
+ newtWinMessage(_("Media ejected"), _("OK"),
+ _("The disc currently inserted to your "
+ "drive was ejected. "
+ "Press %s to continue."),
+ _("OK"));
+ }
else
logMessage(INFO, "noeject in effect, not ejecting cdrom");

--
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-21-2011, 03:24 PM
Ales Kozumplik
 
Default Show a message when ejecting media after test (#656378)

On 06/21/2011 05:17 PM, Martin Sivak wrote:

---
loader/cdinstall.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)



Ack assuming you have tested it.

Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 03:04 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org