summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* lscpu: support discontinuous NUMA nodesKarel Zak2014-01-061-7/+43
| | | | | | | | | | | lscpu fails to print proper NUMA node values in a system with discontinuous nodes. This patch adds support by creating a nodeidx array to map node numbers. Based on patch from Madhavan Srinivasan <maddy@linux.vnet.ibm.com>. Reported-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/path: add path_strdup()Karel Zak2014-01-062-0/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hexdump: convert a variable type according with fmtAndrew Vagin2014-01-061-6/+6
| | | | | | | | | | | | | | | | | | hexdump works uncorrectly on Rassberry Pi (raspbian wheezy): 0000000 3200000000 3400000000 3600000000 3800000000 a00000000 000000a The problem is that the %qx format is used for printing the (short int) variable. Here is the output from hexdump with this patch: 0000000 3231 3433 3635 3837 0a39 000000a Currently raspbian uses hexdump from bsdmainutils. bsdmainutils: /usr/bin/hexdump Signed-off-by: Andrew Vagin <avagin@openvz.org>
* hexdump: don't access hex after freeing itAndrew Vagin2014-01-061-1/+5
| | | | | | | [kzak@redhat.com: - remove unnecessary code] Signed-off-by: Andrew Vagin <avagin@openvz.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* hexdump: use xcalloc()Karel Zak2014-01-061-1/+2
| | | | | Reported-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: libmount: skip tabfiles-py when pylibmount is disabledMike Frysinger2014-01-061-0/+2
| | | | | | | The default configure disables python support, so this test fails by default. Add a simple check for module availability. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: last: skip when last is not enabledMike Frysinger2014-01-062-0/+4
| | | | | References: https://bugs.gentoo.org/489794 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cal: in man page admit that any week has just one SundayBenno Schulenberg2014-01-061-5/+5
| | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* cal: mention where Gregorian reformation happen in September 1752Sami Kerola2014-01-061-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | In September 1752 the Gregorian reformation happen in Great Britain and Dominions (including what is now the USA). One could argue the cal(1) should consider locale when determining the reformation, but such is nearly impossible implement correctly. The dates when reformation happen are split by areas that cannot be expressed with current locales, for example the Netherlands is split to two and Germany three categories depending on where in the modern country one is. Secondly the track when reformation happen is lost for some countries, Lithuania or Japan are good examples of such. One of the worst for a programmer is Sweden. They got gradual calendar change which made Swedish calendar to be completely out of sync. Later the Swedish calendar jumped in 1753 to be in sync with everyone else. Notice that some countries, including Saudi Arabia, Ethiopia, Nepal, Iran and Afghanistan, still have not adopted the Gregorian calendar. Hence the output of the cal(1) cannot be considered to be correct for everyone. References: http://calendopedia.com/gregory.htm References: http://en.wikipedia.org/wiki/Gregorian_calendar#Gregorian_reform Reviewed-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* losetup: remove warning for unsupported -e and -EKarel Zak2014-01-061-6/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup, mount: remove --pass-fd at allKarel Zak2014-01-063-13/+3Star
| | | | | | | | The option is unsupported since v2.23, let's cleanup man pages and code to remove it at all. Reported-by: "Dale R. Worley" <worley@alum.mit.edu> Signed-off-by: Karel Zak <kzak@redhat.com>
* man: Syntax and spelling fixes.Ville Skyttä2014-01-063-4/+4
| | | | Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
* po: add '--no-wrap' to msgmerge, to not wrap long message linesBenno Schulenberg2014-01-062-1/+4
| | | | | | | | This avoids unneeded churn during POT-file renewal and PO-file updates, as the PO files at the TP are made with '--no-wrap'. Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Acked-by: Sami Kerola <kerolasa@iki.fi>
* mount: add note about "noauto" to --all descriptionKarel Zak2013-12-121-1/+4
| | | | | References: https://bugzilla.redhat.com/show_bug.cgi?id=1039905 Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: Identify extN file system properlyLukas Czerner2013-12-121-180/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently when trying to identify extN file system we're playing games with searching for kernel modules and parsing /proc/filesystem. All of this just because ext4 module can be used to mount ext3 and ext2 file systems on recent kernel and also because of ext4dev. However all of this is not necessary. Ext4 module which does support mounting ext2 and ext3 file system is able to recognize and mount ext2 and ext3 type so there is no need to disguise it and ext4dev should only be ever used for testing and not as fallback when other modules are missing (use -t instead). This also introduces a bug when in situation that we only have ext4 modules with ext2/ext3 support which is not loaded and we try to mount ext2 file system we will mount it incorrectly as ext4. This will not happen if the ext4 module is already loaded. With this patch we remove all the unnecessary checks and return the real type of the file system which is on the device. This fixes the issue. However on the kernel which was not compiled with EXT4_USE_FOR_EXT23 support one would have to provide file system type (-t) to be able to mount the file system with ext4 driver. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: small inprovements to usage and man page of fstrimBenno Schulenberg2013-12-122-8/+9
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* fstrim: de-duplicate list of filesystemsKarel Zak2013-12-111-1/+15
| | | | | Reported-by: Pádraig Brady <P@draigBrady.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* findmnt: add -U to de-deplicate filesystemsKarel Zak2013-12-111-2/+18
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_table_uniq_fs()Karel Zak2013-12-114-14/+158
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* findmnt: cleanup usage()Karel Zak2013-12-111-39/+34Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim: add --all to discard all filesystemKarel Zak2013-12-103-31/+202
| | | | | | | | | | | | * read /proc/self/mountinfo to get filesystems * ignore net and pseudo filesystems * ignore unaccessible filesystems (over mounted by another FS) * read disk sysfs queue/discard_granularity to detect is discard support * call FITRIM ioctl * silently ignore EOPNOTSUPP (for example LUKS without discard) and ENOTTY (for example vfat) errors Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add efivarfs to the list of pseudo filesystemsKarel Zak2013-12-101-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim: cleanup usage()Karel Zak2013-12-101-4/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* taskset: fix PERMISSIONS section of taskset man pageRik van Riel2013-12-101-2/+3
| | | | | | | | | A user is always allowed to change the CPU affinity of his or her own processes. CAP_SYS_NICE is only required to change the affinity of another user's process. Signed-off-by: Rik van Riel <riel@redhat.com> Reported-by: Joe Mario <jmario@redhat.com>
* cal: use month contents structure for --year printingSami Kerola2013-12-061-184/+45Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* cal: use month contents structure for --three printingSami Kerola2013-12-061-110/+26Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* cal: add month contents structureSami Kerola2013-12-061-7/+169
| | | | | | | This changes determination of calendar month content completely, as well as outputing. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* cal: determine how many header lines are needed at initializationSami Kerola2013-12-061-31/+22Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tests: cal: do not let --week=<num> to adjust requested monthSami Kerola2013-12-061-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>
* cal: make user request to be part of read-only control structSami Kerola2013-12-061-65/+73
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tests: cal: take account week numbers when determing month lenghtSami Kerola2013-12-061-8/+4Star
| | | | | | | 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>
* cal: determine output width at beginning of run and reuse resultSami Kerola2013-12-061-47/+38Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* cal: simplify ascii_weeknum() functionSami Kerola2013-12-061-5/+2Star
| | | | | | | 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>
* cal: make day_in_week() use same variable names as other functionsSami Kerola2013-12-061-14/+14
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* cal: add input variable names to function prototypesSami Kerola2013-12-061-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>
* cal: rename ascii_wnum() to ascii_weeknum()Sami Kerola2013-12-061-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>
* cal: use control structure for run time configurationSami Kerola2013-12-061-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>
* script: script input redirection / eof handlingKarel Zak2013-12-031-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>
* hexdump: Create struct hexdump containing previously global variables.Ondrej Oprala2013-12-024-89/+90
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: add __attribute__ ((__noreturn__)) to bad*() functionsOndrej Oprala2013-12-021-24/+20Star
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: rename struct _fs to struct hexdump_fs and remove its typedefOndrej Oprala2013-12-024-15/+15
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: rename struct _fu to struct hexdump_fu and remove its typedefOndrej Oprala2013-12-024-15/+15
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: Rename struct _pr to struct hexdump_pr and remove it's typedefOndrej Oprala2013-12-025-18/+20
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: rename rewrite to rewrite_rulesOndrej Oprala2013-12-023-3/+3
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: rename add to add_fmtOndrej Oprala2013-12-023-19/+19
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: Merge hexsyntax.c into hexdump.cOndrej Oprala2013-12-024-163/+117Star
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: add the prefix 'hexdump-' to {conv,display,parse}.cOndrej Oprala2013-12-024-3/+3
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* script: check that stdin is a terminalKarel Zak2013-12-021-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* setterm: fix -dump man page infoKarel Zak2013-12-021-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>
* agetty: support the special terminal on first serial line on a S/390Werner Fink2013-12-021-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>