Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 307129 Details for
Bug 448997
Support eject on halt
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
upstart patch
halt-eject.patch (text/plain), 1.59 KB, created by
Jeremy Katz
on 2008-05-29 20:15:18 UTC
(
hide
)
Description:
upstart patch
Filename:
MIME Type:
Creator:
Jeremy Katz
Created:
2008-05-29 20:15:18 UTC
Size:
1.59 KB
patch
obsolete
>=== modified file 'compat/sysv/reboot.c' >--- compat/sysv/reboot.c 2008-02-29 16:17:17 +0000 >+++ compat/sysv/reboot.c 2008-05-29 20:05:10 +0000 >@@ -39,6 +39,7 @@ > > #include <linux/if.h> > #include <linux/hdreg.h> >+#include <linux/cdrom.h> > > #include <nih/macros.h> > #include <nih/main.h> >@@ -95,6 +96,7 @@ > /* Prototypes for static functions */ > static void down_drives (void); > static void down_interfaces (void); >+static void eject_drive (void); > > > /** >@@ -139,6 +141,8 @@ > **/ > static int exit_only = FALSE; > >+static char *eject_device = NULL; >+ > > /** > * options: >@@ -156,6 +160,8 @@ > NULL, NULL, &disk_standby, NULL }, > { 'i', NULL, N_("bring down network interfaces"), > NULL, NULL, &interface_down, NULL }, >+ { 'e', NULL, N_("eject the given device"), >+ NULL, "DEVICE", &eject_device, NULL }, > > /* Compatibility option, just causes us to exit */ > { 'w', NULL, NULL, NULL, NULL, &exit_only, NULL }, >@@ -275,6 +281,10 @@ > if (disk_standby) > down_drives (); > >+ /* If we need to eject a device, do it now */ >+ if (eject_device) >+ eject_drive (); >+ > /* Do the syscall */ > switch (mode) { > case REBOOT: >@@ -298,6 +308,28 @@ > return 0; > } > >+/** >+ * eject_drive: >+ * >+ * Eject the drive given on the command line >+ **/ >+static void >+eject_drive (void) >+{ >+ int fd; >+ >+ fd = open(eject_device, O_RDONLY | O_NONBLOCK); >+ if (fd < 0) { >+ nih_warn (_("Unable to open device %s to eject: %s"), eject_device, >+ strerror(errno)); >+ return; >+ } >+ >+ if (ioctl(fd, CDROMEJECT, 1)) { >+ nih_warn (_("Unable to eject device %s: %s"), eject_device, >+ strerror(errno)); >+ } >+} > > /** > * down_drives: >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 448997
: 307129 |
307131