Dennis H Jensen [Wed, 22 May 2013 11:12:08 +0000 (13:12 +0200)]
logger: add support for --prio-prefix when logging stdin
This patch adds a new option to logger that will make it look for a
priority prefix <n> at the beginning of every line. The priority is
a single decimal number formed as explained in syslog(3).
If a prefix is found logger will log the message using the found
facility and level in that prefix, if the prefix doesn't contain a
facility the default facility specified by the -p option will be used.
If no prefix is found, logger will use the priority specified by -p.
[kzak@redhat.com: - add --prio-prefix to usage() output]
Signed-off-by: Dennis H Jensen <dennis.h.jensen@siemens.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 28 May 2013 13:23:59 +0000 (15:23 +0200)]
Merge branch 'cal-fourth' of git://github.com/kerolasa/lelux-utiliteetit
* 'cal-fourth' of git://github.com/kerolasa/lelux-utiliteetit:
docs: cal: stop telling year 9999 is upper limit
tests: check cal works when year is far in future
cal: remove arbitrary limit of maxium year being 9999
cal: use Claus Tøndering's day of the week algorithm
cal: simplify day_in_week() calculation
cal: mark all functions static
cal: stop trimming whitespaces
tests: add cal day color corner cases
docs: cal: add --color option description to manual page
cal: add --color to usage()
cal: support --color[={auto,always,never}]
cal: de-duplicate julian specific functions
cal: remove unnecessary initializations
cal: simplify calendar reformat calculations
tests: add calendar reformation check
cal: clean up use of constants
cal: convert function like definitions to functions
cal: fix preprocessor directive indendation
Sami Kerola [Mon, 29 Apr 2013 21:30:51 +0000 (22:30 +0100)]
cal: simplify day_in_week() calculation
The day_in_week() can be made easier to read, and should return invalid
weekday at the time of missing 11 days at September 1752.
Reported-by: Thomas Bächler <thomas@archlinux.org>
References: http://www.spinics.net/lists/util-linux-ng/msg07910.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sun, 28 Apr 2013 20:11:12 +0000 (21:11 +0100)]
cal: mark all functions static
Proposed-by: Dave Reisner <dreisner@archlinux.org>
Reference: http://marc.info/?l=util-linux-ng&m=136717012419551&w=2 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sun, 28 Apr 2013 08:06:40 +0000 (09:06 +0100)]
cal: clean up use of constants
The commit also adds few new symbolic names, such as DAYS_IN_WEEK. While
these definitions may look a little too trivial to have I am sure they
ease understanding what is going on in code where they are used.
Reviewed-by: Thomas Bächler <thomas@archlinux.org> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Karel Zak [Thu, 23 May 2013 07:25:06 +0000 (09:25 +0200)]
agetty: allow full control on CLOCAL flag
Now the -L option allows to explicitly enable CLOCAL flag.
Unfortunately sometimes it's necessary to clear the flag. This patch
add optional argument =<mode> to specify 'auto', 'always' and 'never'
to control CLOCAL flag.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=816342 Signed-off-by: Karel Zak <kzak@redhat.com>
Gilles Espinasse [Mon, 13 May 2013 14:52:28 +0000 (16:52 +0200)]
tests: new warning fix
2.23 added -Wstrict-prototypes check. Fix make check showing
CC tests/helpers/test_md5.o
tests/helpers/test_md5.c:8: warning: function declaration isn't a prototype
Karel Zak [Tue, 21 May 2013 09:32:29 +0000 (11:32 +0200)]
build-sys: always check for setns() and unshare() libs functions
$ ./configure --disable-unshare
$ make nsenter
CC sys-utils/nsenter.o
In file included from sys-utils/nsenter.c:36:0:
./include/namespace.h:31:19: error: static declaration of ‘unshare’ follows non-static declaration
In file included from /usr/include/sched.h:42:0,
from sys-utils/nsenter.c:23:
/usr/include/bits/sched.h:86:12: note: previous declaration of ‘unshare’ was here
make: *** [sys-utils/nsenter.o] Error 1
We have to always check for the libc function independently on
--disable-{unshare,nsenter} to avoid collision between local and libc
declarations.
Reported-by: "Gabor Z. Papp" <gzp@papp.hu> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 14 May 2013 08:32:56 +0000 (10:32 +0200)]
libmount: don't ignore root fs on umount -a
The release v2.22 (the new umount) introduces a regression when root
fs is excluded from umount --all. There is not reason for this
exception. The libmount should be smart enough to disable mtab update
after rootfs umount.
Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Mike Frysinger [Wed, 8 May 2013 22:12:04 +0000 (18:12 -0400)]
standard SEE ALSO section of man pages
The standard format is to seperate each entry with a comma, and
for each one to be on a line by itself. Most util-linux pages
follow this, but a few do not.
The function sets loopdev size according to backing file size. The
problem is that the backing file could be a block device where
stat.st_size is zero, so we have to use blkdev_get_size() for block
devices.
Addresses: https://bugs.archlinux.org/task/35193 Reported-by: Dave Reisner <d@falconindy.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 6 May 2013 15:20:03 +0000 (17:20 +0200)]
libblkid: fix blkid_parse_tag_string() to ignore incomplete tags
fstab entry:
FOO= / btrfs defaults 1 1
Program received signal SIGABRT, Aborted.
0x00007f016ccd8819 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
at ../sysdeps/unix/sysv/linux/libc_fatal.c:196
Reported-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Sami Kerola [Sat, 13 Apr 2013 19:54:44 +0000 (20:54 +0100)]
include: add close_fd() for noticing write errors before close()
Essentially this helper function is similar to close_stream(), but for
file descriptors.
When a file descriptors are close()'d status of write is often
overlooked. The close_fd() will try to determine what happen to writes
with fsync() before closing the file descriptor.