summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/howto-pull-request.txt2
-rw-r--r--configure.ac2
-rw-r--r--lib/blkdev.c12
-rw-r--r--libblkid/src/read.c13
-rw-r--r--misc-utils/look.c10
-rw-r--r--sys-utils/eject.c19
-rw-r--r--sys-utils/hwclock.8.in2
-rw-r--r--sys-utils/ipcutils.c4
-rw-r--r--term-utils/agetty.c7
-rw-r--r--text-utils/ul.c9
10 files changed, 25 insertions, 55 deletions
diff --git a/Documentation/howto-pull-request.txt b/Documentation/howto-pull-request.txt
index 924f22a0a..dfa397780 100644
--- a/Documentation/howto-pull-request.txt
+++ b/Documentation/howto-pull-request.txt
@@ -150,7 +150,7 @@ The following changes since commit 17bf9c1c39b4f35163ec5c443b8bbd5857386ddd:
are available in the git repository at:
- git://github.com/yourlogin/lelux-utiliteetit.git textual
+ git://github.com/yourlogin/util-linux.git textual
----------------------------------------------------------------
and copy paste it to 0000-cover-letter.patch file somewhere near 'BLURB
diff --git a/configure.ac b/configure.ac
index 871a5b7d3..31197abc2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -220,6 +220,7 @@ AC_CHECK_HEADERS([ \
sys/ioccom.h \
sys/ioctl.h \
sys/mkdev.h \
+ sys/param.h \
sys/prctl.h \
sys/queue.h \
sys/resource.h \
@@ -355,7 +356,6 @@ AC_CHECK_FUNCS([ \
strnchr \
strndup \
strnlen \
- strtoull \
sysconf \
sysinfo \
updwtmp \
diff --git a/lib/blkdev.c b/lib/blkdev.c
index a29352963..c4ebfaba0 100644
--- a/lib/blkdev.c
+++ b/lib/blkdev.c
@@ -19,14 +19,10 @@
#endif
#ifdef HAVE_SYS_DISK_H
-#ifdef HAVE_SYS_QUEUE_H
-#include <sys/queue.h> /* for LIST_HEAD */
-#endif
-#include <sys/disk.h>
-#endif
-
-#ifdef __FreeBSD_kernel__
-#include <sys/disk.h>
+# ifdef HAVE_SYS_QUEUE_H
+# include <sys/queue.h> /* for LIST_HEAD */
+# endif
+# include <sys/disk.h>
#endif
#include "blkdev.h"
diff --git a/libblkid/src/read.c b/libblkid/src/read.c
index 81ab0dfd6..41e564f4e 100644
--- a/libblkid/src/read.c
+++ b/libblkid/src/read.c
@@ -32,13 +32,6 @@
# include <stdlib.h>
#endif
-#ifdef HAVE_STRTOULL
-#define STRTOULL strtoull /* defined in stdlib.h if you try hard enough */
-#else
-/* FIXME: need to support real strtoull here */
-#define STRTOULL strtoul
-#endif
-
#ifdef TEST_PROGRAM
#define blkid_debug_dump_dev(dev) (debug_dump_dev(dev))
static void debug_dump_dev(blkid_dev dev);
@@ -330,14 +323,14 @@ static int parse_tag(blkid_cache cache, blkid_dev dev, char **cp)
/* Some tags are stored directly in the device struct */
if (!strcmp(name, "DEVNO"))
- dev->bid_devno = STRTOULL(value, 0, 0);
+ dev->bid_devno = strtoull(value, 0, 0);
else if (!strcmp(name, "PRI"))
dev->bid_pri = strtol(value, 0, 0);
else if (!strcmp(name, "TIME")) {
char *end = NULL;
- dev->bid_time = STRTOULL(value, &end, 0);
+ dev->bid_time = strtoull(value, &end, 0);
if (end && *end == '.')
- dev->bid_utime = STRTOULL(end + 1, 0, 0);
+ dev->bid_utime = strtoull(end + 1, 0, 0);
} else
ret = blkid_set_tag(dev, name, value, strlen(value));
diff --git a/misc-utils/look.c b/misc-utils/look.c
index dc6a8d0fc..96a02c41d 100644
--- a/misc-utils/look.c
+++ b/misc-utils/look.c
@@ -153,9 +153,6 @@ main(int argc, char *argv[])
if ((fd = open(file, O_RDONLY, 0)) < 0 || fstat(fd, &sb))
err(EXIT_FAILURE, "%s", file);
front = mmap(NULL, (size_t) sb.st_size, PROT_READ,
-#ifdef MAP_FILE
- MAP_FILE |
-#endif
MAP_SHARED, fd, (off_t) 0);
if
#ifdef MAP_FAILED
@@ -164,13 +161,6 @@ main(int argc, char *argv[])
((void *)(front) <= (void *)0)
#endif
err(EXIT_FAILURE, "%s", file);
-
-#if 0
- /* workaround for mmap problem (rmiller@duskglow.com) */
- if (front == (void *)0)
- return 1;
-#endif
-
back = front + sb.st_size;
return look(front, back);
}
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;
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 2ac0644df..1aafe72a1 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -45,15 +45,16 @@
#include "widechar.h"
#include "ttyutils.h"
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
#if defined(__FreeBSD_kernel__)
#include <pty.h>
-#include <sys/param.h>
#endif
-
#ifdef __linux__
# include <sys/kd.h>
-# include <sys/param.h>
# define USE_SYSLOG
# ifndef DEFAULT_VCTERM
# define DEFAULT_VCTERM "linux"
diff --git a/text-utils/ul.c b/text-utils/ul.c
index 30cad791d..7765b571e 100644
--- a/text-utils/ul.c
+++ b/text-utils/ul.c
@@ -174,15 +174,6 @@ int main(int argc, char **argv)
termtype = getenv("TERM");
- /*
- * FIXME: why terminal type is lpr when command begins with c and has
- * no terminal? If this behavior can be explained please insert
- * reference or remove the code. In case this truly is desired command
- * behavior this should be mentioned in manual page.
- */
- if (termtype == NULL || (argv[0][0] == 'c' && !isatty(STDOUT_FILENO)))
- termtype = "lpr";
-
while ((c = getopt_long(argc, argv, "it:T:Vh", longopts, NULL)) != -1)
switch (c) {