summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-12-06tests: cal: do not let --week=<num> to adjust requested monthSami Kerola1-42/+42
The previous commit made --week=<number> to have smaller weight value than a month supplied by user. The commit started to print the month that has more days at the week when a week is split to two months, and only one month output is requested. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: make user request to be part of read-only control structSami Kerola1-65/+73
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06tests: cal: take account week numbers when determing month lenghtSami Kerola1-8/+4
The month header does not need to wrap if month width with week number allows printing to single line. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: determine output width at beginning of run and reuse resultSami Kerola1-47/+38
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: simplify ascii_weeknum() functionSami Kerola1-5/+2
Either the week is or isn't highlighted, there is no need to over complicate printing of that. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: make day_in_week() use same variable names as other functionsSami Kerola1-14/+14
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: add input variable names to function prototypesSami Kerola1-16/+18
While prototypes such as 'function(int, int, char, int);' are legal they do not help when trying to understand how the function is expected to be used. Adding variable names gives at least a hint when looking the prototypes. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: rename ascii_wnum() to ascii_weeknum()Sami Kerola1-4/+4
Week is not long word, so it does not need to be enshorted and made more difficult to understand. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: use control structure for run time configurationSami Kerola1-131/+140
Runtime configuration is set at the time of command line option parsing, and other initialization. Later the configuration is read-only. This should make code a little bit more understandable. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-03script: script input redirection / eof handlingKarel Zak1-19/+79
echo "ps uf" | script does not work because script assume that stdin is terminal and it does not forward EOF to the pty. This patch: * make non-tty use-case more robust (don't call tty ioclts to non-tty file descriptors. * send EOF (CTL('D') control char) to the master channel when detected eof by read() on stdin * wait for empty master and slave file descriptors to be sure that we don't miss date for typescript. This is also necessary to be sure that slave channel (shell) is completely initialized otherwise EOF is ignored. Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-12-02hexdump: Create struct hexdump containing previously global variables.Ondrej Oprala4-89/+90
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02hexdump: add __attribute__ ((__noreturn__)) to bad*() functionsOndrej Oprala1-24/+20
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02hexdump: rename struct _fs to struct hexdump_fs and remove its typedefOndrej Oprala4-15/+15
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02hexdump: rename struct _fu to struct hexdump_fu and remove its typedefOndrej Oprala4-15/+15
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02hexdump: Rename struct _pr to struct hexdump_pr and remove it's typedefOndrej Oprala5-18/+20
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02hexdump: rename rewrite to rewrite_rulesOndrej Oprala3-3/+3
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02hexdump: rename add to add_fmtOndrej Oprala3-19/+19
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02hexdump: Merge hexsyntax.c into hexdump.cOndrej Oprala4-163/+117
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02hexdump: add the prefix 'hexdump-' to {conv,display,parse}.cOndrej Oprala4-3/+3
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02script: check that stdin is a terminalKarel Zak1-0/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-12-02setterm: fix -dump man page infoKarel Zak1-1/+1
It seems that setterm -dump does not dump terminal attributes, but the man page says -dump includes the attributes. Let's fix the man page. Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-12-02agetty: support the special terminal on first serial line on a S/390Werner Fink1-0/+18
which is due legacy reasons a block terminal of type 3270 or higher. Whereas the second serial line on a S/390(x) is a real character terminal which is compatible with VT220. Signed-off-by: Werner Fink <werner@suse.de>
2013-12-02mount man page cleanupsPhillip Susi1-29/+39
Fowarding this patch submitted by Bjarni Ingi Gislason <bjarniig@rhi.hi.is> to deb bug #674595.
2013-12-02mount.8: fix grammarPhillip Susi1-1/+1
Switch "A unbindable" to "An unbindable" Reported-by: Regid Ichira <regid23@nt1.in> Signed-off-by: Phillip Susi <psusi@ubuntu.com>
2013-12-02pylibmount: correctly import from pylibmount.soDave Reisner1-1/+1
Without this, python is unable to find the module: $ python -c 'import libmount' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.3/site-packages/libmount/__init__.py", line 1, in <module> from pylibmount import * ImportError: No module named 'pylibmount' Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-12-02namei: align missing files with rest of the print outSami Kerola2-1/+10
This change should make namei output more readable when multiple arguments are supplied. The old: $ namei -l /usr/foo f: /usr/foo drwxr-xr-x root root / drwxr-xr-x root root usr foo - No such file or directory The new: $ namei -l /usr/foo f: /usr/foo drwxr-xr-x root root / drwxr-xr-x root root usr foo - No such file or directory Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-02losetup, agetty: remove unnecessary if's before free()Sami Kerola2-8/+4
Reference: http://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/useless-if-before-free Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-11-27libfdisk: (dos) warn on type 0Karel Zak1-0/+3
This is old warning, but somehow lost during rewrite to libfdisk. Sorry. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-27libfdisk: (dos) fix free part counterKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-27libblkid: fix sgi PT parser to report system partitionsKarel Zak1-2/+1
... to be compatible with Linux kernel. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-25fdisk: (gpt) more human readable info about free spaceKarel Zak1-2/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-25fdisk: don't care about partition typeKarel Zak1-16/+22
fdisk allows to overwrite existing partition if the partition has partition type set to zero (very unusual, but possible). This is incorrect because such partition is pretty valid (and Linux kernel does not care about the type at all). For example: Device Boot Start End Blocks Id System /dev/sdb1 2048 22527 10240 83 Linux /dev/sdb2 22528 227327 102400 0 Empty ^^^^^ ^^^^^^^^ Command (m for help): n Partition type: p primary (1 primary, 0 extended, 3 free) e extended Select (default p): Using default response p Partition number (3,4, default 3): First sector (22528-1228799, default 22528): ^^^^^^^ .. if user follows the default then the result are overlapping partitions: Device Boot Start End Blocks Id System /dev/sdb1 2048 22527 10240 83 Linux /dev/sdb2 22528 227327 102400 0 Empty /dev/sdb3 22528 1228799 603136 83 Linux ^^^^^ ... and if you call "mkfs /dev/sdb3" then you lost data on sdb2. Sad thing. Reported-by: Marc MERLIN <marc@merlins.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-25fdisk: fix nasty coding styleKarel Zak1-1/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-19fdisk: fix usage(), -l [<disk>]Karel Zak1-2/+2
Add square brackets, <disk> is optional for -l. Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-19umount: fix umount by tag for non-rootsKarel Zak1-3/+5
$ umount LABEL=foo currently does not work for non-root users as umount uses the LABEL= as a path in sanitize_path(). Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-19libblkid: fix memory leak in blkid_parse_tag_string()Karel Zak1-5/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-19mount: make NAME=value tags usable for non-rootKarel Zak1-4/+22
The libmount does not care if we set source or target, it's able to swap it, but the mount.c function sanitize_paths() does not work as expected if we set NAME=value as target. It means that $ mount LABEL=foo does not work for non-root users (since 51e3530cdcb1d4f3ab91ae953ebc5adcdc5f9239, v2.24). This patch also checks if source or target is specified more than once. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-19libmount: add mnt_tag_is_valid()Karel Zak4-0/+23
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-19fsck: add ext4 to list of filesystems with progress bars in fsck man pagePhillip Susi1-1/+1
Signed-off-by: Phillip Susi <psusi@ubuntu.com>
2013-11-19mount: fix man mount page typePhillip Susi1-1/+1
Slight grammatical error in the mount man page Signed-off-by: Phillip Susi <psusi@ubuntu.com>
2013-11-19setpriv: simplify usage()Karel Zak1-2/+2
Let's keep usage() simple and details in the man page. The current brief description in usage() seems confusing for some users. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-19Merge branch 'fixes' of https://github.com/rudimeier/util-linuxKarel Zak1-0/+1
* 'fixes' of https://github.com/rudimeier/util-linux: tests: fix fdisk GPT test
2013-11-19libfdisk: (sgi) generate partname according to partition positionKarel Zak1-4/+6
The SGI drive currently counts only usable partitions, that's wrong as Linux kernel counts all partition to generate partition number. For example: Kernel: sdb 8:16 0 600M 0 disk ├─sdb9 8:25 0 2M 0 part └─sdb11 8:27 0 596.2M 0 part Fdisk: Pt# Device Info Start End Sectors Id System 9: /dev/sdb1 0 4095 4096 0 SGI volhdr 11: /dev/sdb2 0 1220939 1220940 6 SGI volume Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-18unshare: add more hints about mount namespaces to the man pageKarel Zak1-2/+8
There is also idea (by Lennart) to add --propagation=[shared|private|slave|off] to unshare(1), but it seems unnecessary and too complex as everyone can call mount(8) after unshare(1) to setup a proper namespace. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-18lsblk: fix -D segfaultKarel Zak1-3/+3
References: https://bugzilla.redhat.com/show_bug.cgi?id=1031262 Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-18mkfs.minix: fix fscanf() format string [coverity scan]Karel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-14tests: fix fdisk GPT testRuediger Meier1-0/+1
There was a missing newline since cd05de50. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2013-11-14script: restore errno in signal handlerKarel Zak1-0/+3
References: https://plus.google.com/+LennartPoetteringTheOneAndOnly/posts/gHSscCJkakd Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-14script: don't call TIOCGWINSZ in signal handlerKarel Zak1-3/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-14mkswap: remove cruft from the man pagePhillip Susi1-9/+1
I don't think there's any reason to continue to mention behavior of kernels older than 10 years. Signed-off-by: Phillip Susi <psusi@ubuntu.com>