diff options
author | Karel Zak | 2015-01-08 14:53:01 +0100 |
---|---|---|
committer | Karel Zak | 2015-01-08 14:53:01 +0100 |
commit | 3d9644f30de6eb4bf015f840ad895260f7276f5c (patch) | |
tree | 8ccfb78bf0ff63921bce4800d094973a8a990e81 /sys-utils | |
parent | Merge branch 'master' of https://github.com/pali/util-linux (diff) | |
parent | eject: add verbosity to cdrom door lock error (diff) | |
download | kernel-qcow2-util-linux-3d9644f30de6eb4bf015f840ad895260f7276f5c.tar.gz kernel-qcow2-util-linux-3d9644f30de6eb4bf015f840ad895260f7276f5c.tar.xz kernel-qcow2-util-linux-3d9644f30de6eb4bf015f840ad895260f7276f5c.zip |
Merge branch '2015wk01' of https://github.com/kerolasa/lelux-utiliteetit
* '2015wk01' of https://github.com/kerolasa/lelux-utiliteetit:
eject: add verbosity to cdrom door lock error
libblkid: assume strtoull() is available
ipcs: remove FIXME markup
ul: remove unexplained TERM=lpr override
look: remove dead code
docs: make tools/checkmans.sh to pass without warnings
build-sys: fix make checkincludes warnings
docs: add howto-pull-request.txt
docs: small improvements to howto-contribute.txt
Conflicts:
Documentation/howto-pull-request.txt
Diffstat (limited to 'sys-utils')
-rw-r--r-- | sys-utils/eject.c | 19 | ||||
-rw-r--r-- | sys-utils/hwclock.8.in | 2 | ||||
-rw-r--r-- | sys-utils/ipcutils.c | 4 |
3 files changed, 12 insertions, 13 deletions
diff --git a/sys-utils/eject.c b/sys-utils/eject.c index 2114780a3..4f7d6e651 100644 --- a/sys-utils/eject.c +++ b/sys-utils/eject.c @@ -335,20 +335,23 @@ static void auto_eject(const struct eject_control *ctl) } /* - * Stops CDROM from opening on manual eject pressing the button. + * Stops CDROM from opening on manual eject button press. * This can be useful when you carry your laptop * in your bag while it's on and no CD inserted in it's drive. * Implemented as found in Documentation/ioctl/cdrom.txt - * - * TODO: Maybe we should check this also: - * EDRIVE_CANT_DO_THIS Door lock function not supported. - * EBUSY Attempt to unlock when multiple users - * have the drive open and not CAP_SYS_ADMIN */ static void manual_eject(const struct eject_control *ctl) { - if (ioctl(ctl->fd, CDROM_LOCKDOOR, ctl->i_arg) < 0) - err(EXIT_FAILURE, _("CD-ROM lock door command failed")); + if (ioctl(ctl->fd, CDROM_LOCKDOOR, ctl->i_arg) < 0) { + switch (errno) { + case EDRIVE_CANT_DO_THIS: + errx(EXIT_FAILURE, _("CD-ROM door lock is not supported")); + case EBUSY: + errx(EXIT_FAILURE, _("other users have the drive open and not CAP_SYS_ADMIN")); + default: + err(EXIT_FAILURE, _("CD-ROM lock door command failed")); + } + } if (ctl->i_arg) info(_("CD-Drive may NOT be ejected with device button")); diff --git a/sys-utils/hwclock.8.in b/sys-utils/hwclock.8.in index 0c654a591..c2931efb9 100644 --- a/sys-utils/hwclock.8.in +++ b/sys-utils/hwclock.8.in @@ -657,7 +657,7 @@ synchronizes the System Clock. .PP If your system runs with 11 minute mode on, it may need .B hwclock \-\-hctosys -in a startup script, especially if the Hardware Clock is configured to to use +in a startup script, especially if the Hardware Clock is configured to use the local timescale. The first user space command to set the System Clock informs the diff --git a/sys-utils/ipcutils.c b/sys-utils/ipcutils.c index d1858a06a..1e18b8a37 100644 --- a/sys-utils/ipcutils.c +++ b/sys-utils/ipcutils.c @@ -387,10 +387,6 @@ int ipc_msg_get_info(int id, struct msg_data **msgds) if (id > -1) { /* ID specified */ if (id == p->msg_perm.id) { - /* - * FIXME: q_qbytes are not in /proc - * - */ if (msgctl(id, IPC_STAT, &msgseg) != -1) p->q_qbytes = msgseg.msg_qbytes; i = 1; |