]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
12 years agoblkid: export ID_PART_TABLE_UUID
Karel Zak [Thu, 13 Jun 2013 12:36:02 +0000 (14:36 +0200)] 
blkid: export ID_PART_TABLE_UUID

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: set PTUUID for GPT and DOS
Karel Zak [Thu, 13 Jun 2013 12:35:34 +0000 (14:35 +0200)] 
libblkid: set PTUUID for GPT and DOS

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: add functions to set PTUUID
Karel Zak [Thu, 13 Jun 2013 12:35:05 +0000 (14:35 +0200)] 
libblkid: add functions to set PTUUID

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: make uuid_is_empty() usable for whole library
Karel Zak [Thu, 13 Jun 2013 12:33:47 +0000 (14:33 +0200)] 
libblkid: make uuid_is_empty() usable for whole library

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomkfs.bfs: fix 64-Bit and endian problems
ihno [Fri, 7 Jun 2013 18:29:42 +0000 (20:29 +0200)] 
mkfs.bfs: fix 64-Bit and endian problems

[kzak@redhat.com: - use cpu_to_leXX() macros rather than htoleXX()]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoMerge branch 'master' of https://github.com/eric-s-raymond/util-linux
Karel Zak [Thu, 13 Jun 2013 11:32:02 +0000 (13:32 +0200)] 
Merge branch 'master' of https://github.com/eric-s-raymond/util-linux

* 'master' of https://github.com/eric-s-raymond/util-linux:
  Fix broken list syntax.
  Restore use of correct alternation syntax using { | }.
  Re-layout a FILES section in the traditional style.
  Remove another .ti for .RS/.RE, and remove a .TP that broke list parsing.
  Replace .IP o with .IP \(bu, using the [nt]roff bullet character.
  Replace .ti operations with equivalent .RS/.RE pairs.

12 years agofdisk: add support for the MicroBlaze architecture
Nathan Rossi [Fri, 7 Jun 2013 04:08:06 +0000 (14:08 +1000)] 
fdisk: add support for the MicroBlaze architecture

Add support to fdisk for the MicroBlaze architecture.

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
12 years agoeject: unlock door before issuing CDROMEJECT command
Aaron Lu [Thu, 6 Jun 2013 08:28:37 +0000 (16:28 +0800)] 
eject: unlock door before issuing CDROMEJECT command

If user has inserted a disc into the drive, the drive will normally be
locked. When using eject command to eject the drive, we need to unlock
the door first, or the CDROMEJECT command will fail.

Though the 2nd attmpt to eject the drive with eject_scsi will succeed,
it actually does two things: first to unlock the door and then to eject
the tray, both with the SG_IO ioctl. The problem is, Linux SCSI driver
keeps track of if a device is in locked state or not, if we go with
SG_IO to do the unlocking, the driver will not be aware of the unlocking
and would think the drive is locked while actually it has already been
unlocked by the first SG_IO command.

Fix this by issuing a unlock door command before the CDROMEJECT command
in cdrom_eject. Prior to this fix, the following output is expected when
there is a disc inside:

[aaron@aaronlu util-linux-2.22.2]$ eject -v /dev/sr0
eject: device name is `/dev/sr0'
eject: /dev/sr0: mounted on /run/media/aaron/CD_ROM
eject: /dev/sr0: is whole-disk device
eject: /dev/sr0: is removable device
eject: /run/media/aaron/CD_ROM: unmounting
eject: /dev/sr0: trying to eject using CD-ROM eject command
eject: CD-ROM eject command failed
eject: /dev/sr0: trying to eject using SCSI commands
eject: SCSI eject succeeded

After this fix, the following output is expected:
[aaron@aaronlu util-linux-2.22.2]$ ./eject -v /dev/sr0
lt-eject: device name is `/dev/sr0'
lt-eject: /dev/sr0: mounted on /run/media/aaron/CD_ROM
lt-eject: /dev/sr0: is whole-disk device
lt-eject: /dev/sr0: is removable device
lt-eject: /run/media/aaron/CD_ROM: unmounting
lt-eject: /dev/sr0: trying to eject using CD-ROM eject command
lt-eject: CD-ROM eject command succeeded

And the SCSI device's locked state is correct now.

Signed-off-by: Aaron Lu <aaron.lu@intel.com>
12 years agoagetty: use O_NONBLOCK only for serial lines with CLOCAL
Karel Zak [Thu, 13 Jun 2013 09:06:13 +0000 (11:06 +0200)] 
agetty: use O_NONBLOCK only for serial lines with CLOCAL

 * regression introduced by ef264c830effc91add6da334204215f61eb8515e

 * also increase sleep when O_NONBLOCK used (grr.. this is so stupid
   thing, do we really need O_NONBLOCK for the stupid serial lines?)

References: https://bugzilla.redhat.com/show_bug.cgi?id=972457
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: don't use ptes[] in generic code
Karel Zak [Wed, 12 Jun 2013 15:32:03 +0000 (17:32 +0200)] 
fdisk: don't use ptes[] in generic code

... the array is MBR specific.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoFix broken list syntax.
Eric S. Raymond [Mon, 10 Jun 2013 21:51:31 +0000 (17:51 -0400)] 
Fix broken list syntax.

Bodiless .TP entries and unterminated .TP lists interfere with page
parsing.

12 years agoRestore use of correct alternation syntax using { | }.
Eric S. Raymond [Mon, 10 Jun 2013 21:18:15 +0000 (17:18 -0400)] 
Restore use of correct alternation syntax using { | }.

This is required in order for ther synopsis to be translated into the
corresponding XML markup.

12 years agoRe-layout a FILES section in the traditional style.
Eric S. Raymond [Mon, 10 Jun 2013 19:58:25 +0000 (15:58 -0400)] 
Re-layout a FILES section in the traditional style.

12 years agoRemove another .ti for .RS/.RE, and remove a .TP that broke list parsing.
Eric S. Raymond [Mon, 10 Jun 2013 19:55:45 +0000 (15:55 -0400)] 
Remove another .ti for .RS/.RE, and remove a .TP that broke list parsing.

12 years agoReplace .IP o with .IP \(bu, using the [nt]roff bullet character.
Eric S. Raymond [Mon, 10 Jun 2013 19:48:41 +0000 (15:48 -0400)] 
Replace .IP o with .IP \(bu, using the [nt]roff bullet character.

This will improve the quality of generated HTML. There is a cost,
which is that most terminal emulators will just display the bullet
as a (less visible) dot.  An alternative to this change would be
to use a * character for the bullet.

12 years agoReplace .ti operations with equivalent .RS/.RE pairs.
Eric S. Raymond [Mon, 10 Jun 2013 19:42:06 +0000 (15:42 -0400)] 
Replace .ti operations with equivalent .RS/.RE pairs.

This change makes automatic lifting to XML-DocBook possible, and
should enable generation of better-quality HTML from these pages.

12 years agotextual: improve clarity of some error messages
Benno Schulenberg [Wed, 5 Jun 2013 19:58:13 +0000 (21:58 +0200)] 
textual: improve clarity of some error messages

Reported-by: Petr Písař <petr.pisar@atlas.cz>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agocal: fix few type mismatches
Sami Kerola [Sun, 2 Jun 2013 17:51:25 +0000 (18:51 +0100)] 
cal: fix few type mismatches

Sloppiness from commit e44fe4712140774b677de466affc31e0581ee335.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agorev: reduce stream checking when closing read-only file descriptor
Sami Kerola [Sun, 2 Jun 2013 17:51:18 +0000 (18:51 +0100)] 
rev: reduce stream checking when closing read-only file descriptor

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agorev: simplify new line detection and impossible test
Sami Kerola [Sun, 2 Jun 2013 17:51:17 +0000 (18:51 +0100)] 
rev: simplify new line detection and impossible test

The new line detection is earlier using only '\n' so there should not be
need to search for '\r' later.

The detection whether allocated address is pointing to null seems to be
unnecessary.  Assuming xmalloc() returned valid address space the address
should never be 0.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agorev: stop adding new line at the end when input does not have it
Sami Kerola [Sun, 2 Jun 2013 17:51:16 +0000 (18:51 +0100)] 
rev: stop adding new line at the end when input does not have it

When the rev(1) is executed twice outcome is expected to be exactly what
it was originally.  That includes not adding new line at the end of the
output.  The oneliner below demonstrates earlier issue.

$ printf "abc\n123" | rev | rev

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: add lscpu max mhz to manual and bash completion
Sami Kerola [Sun, 2 Jun 2013 17:51:09 +0000 (18:51 +0100)] 
docs: add lscpu max mhz to manual and bash completion

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolscpu: add max MHz value to make cpu governor effects more visible
Sami Kerola [Sun, 2 Jun 2013 17:51:08 +0000 (18:51 +0100)] 
lscpu: add max MHz value to make cpu governor effects more visible

The existing 'CPU MHz' is usually dynamic value, which CPU governor
changes up on needs of CPU demand.  Assuming lscpu is used to gather
information to a hardware inventory the dynamic value is misleading.  For
inventing the maximum MHz value is more sensible.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolib: remove unused code
Sami Kerola [Sun, 2 Jun 2013 17:51:07 +0000 (18:51 +0100)] 
lib: remove unused code

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: slightly correct the man page of column
Benno Schulenberg [Thu, 30 May 2013 20:55:11 +0000 (22:55 +0200)] 
docs: slightly correct the man page of column

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agodocs: normalize the formatting of man pages for nsenter and unshare
Benno Schulenberg [Thu, 30 May 2013 10:40:51 +0000 (12:40 +0200)] 
docs: normalize the formatting of man pages for nsenter and unshare

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: fix several typos and angular brackets in messages
Benno Schulenberg [Wed, 29 May 2013 19:52:56 +0000 (21:52 +0200)] 
textual: fix several typos and angular brackets in messages

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: harmonize some loop-device error messages
Benno Schulenberg [Wed, 29 May 2013 19:43:49 +0000 (21:43 +0200)] 
textual: harmonize some loop-device error messages

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agomount: (deprecated) fix typo tailed->failed
Yuri Chornoivan [Wed, 29 May 2013 18:38:00 +0000 (21:38 +0300)] 
mount: (deprecated) fix typo tailed->failed

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
12 years agosu: fix exit status if terminated by signal
Ondrej Oprala [Fri, 17 May 2013 08:50:58 +0000 (10:50 +0200)] 
su: fix exit status if terminated by signal

[kzak@redhat.com: - add comment]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: improve grammar and consistency of comments in login.c
Benno Schulenberg [Wed, 29 May 2013 18:09:20 +0000 (20:09 +0200)] 
docs: improve grammar and consistency of comments in login.c

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: tiny alphabetical and grammatical tweak
Benno Schulenberg [Wed, 29 May 2013 17:53:38 +0000 (19:53 +0200)] 
textual: tiny alphabetical and grammatical tweak

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: standardize the spelling of "superuser"
Benno Schulenberg [Wed, 29 May 2013 17:47:48 +0000 (19:47 +0200)] 
textual: standardize the spelling of "superuser"

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: standardize synopsis for login, and improve an error message
Benno Schulenberg [Wed, 29 May 2013 17:46:23 +0000 (19:46 +0200)] 
textual: standardize synopsis for login, and improve an error message

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agorunuser: update man page, add note about -l vs. -p
Karel Zak [Fri, 7 Jun 2013 09:26:46 +0000 (11:26 +0200)] 
runuser: update man page, add note about -l vs. -p

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agologin: use TCSANOW to remove HUPCL
Karel Zak [Wed, 5 Jun 2013 12:31:00 +0000 (14:31 +0200)] 
login: use TCSANOW to remove HUPCL

Fedora 19, kernel 3.9, systemd 204, telnetd with socket activation.

login(1) code:

        ttt.c_cflag &= ~HUPCL;
        tcsetattr(0, TCSAFLUSH, &ttt);

        close(STDIN_FILENO);
        close(STDOUT_FILENO);
        close(STDERR_FILENO);

        signal(SIGHUP, SIG_IGN);        /* so vhangup() wont kill us */
        vhangup();
        signal(SIGHUP, SIG_DFL);

strace :

ioctl(0, SNDCTL_TMR_CONTINUE or SNDRV_TIMER_IOCTL_GPARAMS or TCSETSF, {B9600 opost isig icanon echo ...}) = 0
close(0)                                = 0
close(1)                                = 0
close(2)                                = 0
--- SIGHUP {si_signo=SIGHUP, si_code=SI_KERNEL} ---
--- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=1, si_uid=0} ---
+++ killed by SIGTERM +++

It seems we get SIGHUP (and SIGTERM from systemd) before vhangup().
The problem occur sometimes.

I guess it's because TCSAFLUSH is not applied immediately, so it would
be probably better to use TCSANOW to make the code more robust.

References: https://bugzilla.redhat.com/show_bug.cgi?id=962145
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoagetty: don't remove ECHOCTL from c_lflag
Karel Zak [Mon, 3 Jun 2013 12:06:18 +0000 (14:06 +0200)] 
agetty: don't remove ECHOCTL from c_lflag

It's really unexpected that arrows keys move cursor when agetty/login
asks for login name or password.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=969458
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoagetty: update man page and usage()
Karel Zak [Mon, 3 Jun 2013 08:04:43 +0000 (10:04 +0200)] 
agetty: update man page and usage()

 - baud_rate is optional
 - agetty has been rewritten 2 years ago, so don't blame original
   authors in the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: more robust options string parsing
Karel Zak [Thu, 30 May 2013 11:29:34 +0000 (13:29 +0200)] 
libmount: more robust options string parsing

 # mount -o=rw /dev/sdb /mnt/test
 mount: libmount/src/optmap.c:212: mnt_optmap_get_entry: Assertion `namelen' failed.
 Aborted (core dumped)

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=968786
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosu: ignore --preserve-environment, it's mutually exclusive to --login
Karel Zak [Wed, 29 May 2013 09:32:58 +0000 (11:32 +0200)] 
su: ignore --preserve-environment, it's mutually exclusive to --login

Addresses: http://bugs.gnu.org/10317
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agologger: small coding style changes
Karel Zak [Wed, 29 May 2013 08:56:05 +0000 (10:56 +0200)] 
logger: small coding style changes

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agologger: cleanup usage()
Karel Zak [Wed, 29 May 2013 08:54:51 +0000 (10:54 +0200)] 
logger: cleanup usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agologger: add support for --prio-prefix when logging stdin
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>
12 years agocal: improve coding style
Karel Zak [Tue, 28 May 2013 13:33:05 +0000 (15:33 +0200)] 
cal: improve coding style

 - use static for all global variables
 - use REFORMATION_YEAR macro
 - make if() lines more readable
 - etc.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agocal: simplify colormode parsing
Karel Zak [Tue, 28 May 2013 13:27:22 +0000 (15:27 +0200)] 
cal: simplify colormode parsing

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoMerge branch 'cal-fourth' of git://github.com/kerolasa/lelux-utiliteetit
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

12 years agotextual: fix typo in error message and uniformize their use of period
Benno Schulenberg [Sat, 18 May 2013 07:45:11 +0000 (09:45 +0200)] 
textual: fix typo in error message and uniformize their use of period

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agogetopt: add reference to /usr/share/docs to man page
Karel Zak [Tue, 28 May 2013 10:53:35 +0000 (12:53 +0200)] 
getopt: add reference to /usr/share/docs to man page

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/tty: fix get_terminal_name() usage, cleanup code
Karel Zak [Tue, 28 May 2013 08:04:16 +0000 (10:04 +0200)] 
lib/tty: fix get_terminal_name() usage, cleanup code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: cal: stop telling year 9999 is upper limit
Sami Kerola [Fri, 24 May 2013 22:42:07 +0000 (23:42 +0100)] 
docs: cal: stop telling year 9999 is upper limit

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: check cal works when year is far in future
Sami Kerola [Fri, 24 May 2013 21:54:15 +0000 (22:54 +0100)] 
tests: check cal works when year is far in future

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agocal: remove arbitrary limit of maxium year being 9999
Sami Kerola [Fri, 24 May 2013 21:52:16 +0000 (22:52 +0100)] 
cal: remove arbitrary limit of maxium year being 9999

The change limits year to be unsigned long. In case a year + month name
exceed a column width two lines are used for them.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agocal: use Claus Tøndering's day of the week algorithm
Sami Kerola [Wed, 22 May 2013 21:59:01 +0000 (22:59 +0100)] 
cal: use Claus Tøndering's day of the week algorithm

Reference: http://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week#T.C3.B8ndering.27s_algorithm
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agocal: simplify day_in_week() calculation
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>
12 years agocal: mark all functions static
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>
12 years agocal: stop trimming whitespaces
Sami Kerola [Sun, 28 Apr 2013 14:35:26 +0000 (15:35 +0100)] 
cal: stop trimming whitespaces

Remove trailing spaces from output it is trivial

cal | sed 's/ *$//'

but padding them back is difficult.

CC: Pádraig Brady <P@draigbrady.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add cal day color corner cases
Sami Kerola [Thu, 2 May 2013 18:16:47 +0000 (19:16 +0100)] 
tests: add cal day color corner cases

Check that the first, andn last, possible dates and strange Sep 1752
dates are highlighted correctly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: cal: add --color option description to manual page
Sami Kerola [Wed, 1 May 2013 22:12:16 +0000 (23:12 +0100)] 
docs: cal: add --color option description to manual page

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agocal: add --color to usage()
Sami Kerola [Wed, 1 May 2013 22:07:21 +0000 (23:07 +0100)] 
cal: add --color to usage()

And clean up the usage() function.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agocal: support --color[={auto,always,never}]
Sami Kerola [Tue, 7 May 2013 20:34:57 +0000 (21:34 +0100)] 
cal: support --color[={auto,always,never}]

Similar with dmesg commit 9bc2b51a06dc9cf6244106ac489ab08a91fd4360.

CC: Pádraig Brady <P@draigBrady.com>
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agocal: de-duplicate julian specific functions
Sami Kerola [Sun, 28 Apr 2013 13:09:50 +0000 (14:09 +0100)] 
cal: de-duplicate julian specific functions

The cost is a little bit more complex functions, while the benefit is
couple data flows fewer to mind about.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agocal: remove unnecessary initializations
Sami Kerola [Sun, 28 Apr 2013 11:47:55 +0000 (12:47 +0100)] 
cal: remove unnecessary initializations

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agocal: simplify calendar reformat calculations
Sami Kerola [Sun, 28 Apr 2013 10:59:59 +0000 (11:59 +0100)] 
cal: simplify calendar reformat calculations

The only September 1752 offset calculation that is necessary is whether
Sun or Mon is the first day of the week.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add calendar reformation check
Sami Kerola [Sun, 28 Apr 2013 10:19:28 +0000 (11:19 +0100)] 
tests: add calendar reformation check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agocal: clean up use of constants
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>
12 years agocal: convert function like definitions to functions
Sami Kerola [Sat, 27 Apr 2013 21:51:35 +0000 (22:51 +0100)] 
cal: convert function like definitions to functions

Reviewed-by: Thomas Bächler <thomas@archlinux.org>
Reviewed-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agocal: fix preprocessor directive indendation
Sami Kerola [Sat, 27 Apr 2013 21:09:24 +0000 (22:09 +0100)] 
cal: fix preprocessor directive indendation

And code within the blocks selected by preprocessor to be live code.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoagetty: allow full control on CLOCAL flag
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>
12 years agotests: new warning fix
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

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
12 years agoutil-linux minor typo fixes
Gilles Espinasse [Mon, 13 May 2013 14:51:08 +0000 (16:51 +0200)] 
util-linux minor typo fixes

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
12 years agobuild-sys: always check for setns() and unshare() libs functions
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>
12 years agolscpu: add virtualization types
Karel Zak [Mon, 20 May 2013 14:41:19 +0000 (16:41 +0200)] 
lscpu: add virtualization types

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolscpu: detect more hypervisor vendors
Ondrej Oprala [Mon, 22 Apr 2013 12:18:24 +0000 (08:18 -0400)] 
lscpu: detect more hypervisor vendors

[kzak@redhat.com: - cleanup coding style,
                  - use path_exist()]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agocfdisk: add long options to the command
Sami Kerola [Sat, 13 Apr 2013 19:54:32 +0000 (20:54 +0100)] 
cfdisk: add long options to the command

Includes update to bash completion, and manual as well.

[kzak@redhat.com: - remove <<< syntax from bash-completion script]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosfdisk: don't call BLKRRPART for non-block devices
Karel Zak [Mon, 20 May 2013 11:10:52 +0000 (13:10 +0200)] 
sfdisk: don't call BLKRRPART for non-block devices

Reported-by: Bertrand Jacquin <beber@meleeweb.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agouuidd: clean up error messages
Karel Zak [Tue, 14 May 2013 22:18:27 +0000 (00:18 +0200)] 
uuidd: clean up error messages

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomkfs.cramfs: use standard error message
Karel Zak [Tue, 14 May 2013 21:54:07 +0000 (23:54 +0200)] 
mkfs.cramfs: use standard error message

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agohwclock: use warn() to print cmos errors
Karel Zak [Tue, 14 May 2013 21:41:32 +0000 (23:41 +0200)] 
hwclock: use warn() to print cmos errors

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: use err.h in test
Karel Zak [Tue, 14 May 2013 21:40:51 +0000 (23:40 +0200)] 
libmount: use err.h in test

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agochcpu: clean up error messages
Karel Zak [Tue, 14 May 2013 21:33:59 +0000 (23:33 +0200)] 
chcpu: clean up error messages

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: clean up error messages
Karel Zak [Tue, 14 May 2013 21:29:09 +0000 (23:29 +0200)] 
sulogin: clean up error messages

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: add ReFS magic string
Karel Zak [Tue, 14 May 2013 13:51:35 +0000 (15:51 +0200)] 
libblkid: add ReFS magic string

Reported-by: "Richard W.M. Jones" <rjones@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoblkid: fix typo in ID_FS_AMBIVALEN=
Karel Zak [Tue, 14 May 2013 13:03:30 +0000 (15:03 +0200)] 
blkid: fix typo in ID_FS_AMBIVALEN=

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: don't ignore root fs on umount -a
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>
12 years agolib/tty: don't hardcode terminal fd in get_terminal_name()
Karel Zak [Mon, 13 May 2013 13:40:57 +0000 (15:40 +0200)] 
lib/tty: don't hardcode terminal fd in get_terminal_name()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agostandard SEE ALSO section of man pages
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.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agolsblk: add SERIAL column
Karel Zak [Mon, 13 May 2013 11:33:41 +0000 (13:33 +0200)] 
lsblk: add SERIAL column

 ... to return short serial number of the disk (from udev db)

Addresses: https://github.com/karelzak/util-linux/issues/33
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: add losetup tests
Karel Zak [Mon, 13 May 2013 11:13:24 +0000 (13:13 +0200)] 
tests: add losetup tests

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolosetup: add --raw and --noheadings
Karel Zak [Mon, 13 May 2013 10:00:24 +0000 (12:00 +0200)] 
losetup: add --raw and --noheadings

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolosetup: use warn_size() for regular files only
Karel Zak [Mon, 13 May 2013 09:00:47 +0000 (11:00 +0200)] 
losetup: use warn_size() for regular files only

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/loopdev: fix loopcxt_check_size() to work with blkdevs
Karel Zak [Mon, 13 May 2013 08:54:41 +0000 (10:54 +0200)] 
lib/loopdev: fix loopcxt_check_size() to work with blkdevs

The loopcxt_check_size() is workaround for kernels < v3.9, kernel has
been fixed by commit 541c742a7559eb65f0e36d3e2338c2ca532a3e61.

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>
12 years agolibfdisk: don't re-allocate range string in Ask API
Karel Zak [Thu, 9 May 2013 11:19:58 +0000 (13:19 +0200)] 
libfdisk: don't re-allocate range string in Ask API

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: do not use va_list in the Ask API
Karel Zak [Thu, 9 May 2013 11:06:02 +0000 (13:06 +0200)] 
libfdisk: do not use va_list in the Ask API

  # fdisk /dev/sda
  Welcome to fdisk (util-linux 2.23).

  [...]

  Command (m for help): a
  Segmentation fault (core dumped)

It's too fragile, the va_list implementation is architecture specific
and it seems we need such thing in libfdisk at all.

Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: use MS_SILENT for /{proc,etc}/filesystems
Karel Zak [Thu, 9 May 2013 07:22:50 +0000 (09:22 +0200)] 
libmount: use MS_SILENT for /{proc,etc}/filesystems

mount(8) needs to be doing silent mounts when doing this brute
forcing or when the filesystem is not explicitly specified.

Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: use -Wno-clobbered for some BSD crap
Karel Zak [Tue, 7 May 2013 07:50:22 +0000 (09:50 +0200)] 
build-sys: use -Wno-clobbered for some BSD crap

 * extend UL_WARN_ADD() for accept non-default CFLAGS variable
 * add BSD_WARN_CFLAGS with -Wno-clobbered
 * use all this for pg(1) and more(1)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/colors: add colormode_or_err()
Karel Zak [Tue, 7 May 2013 07:09:35 +0000 (09:09 +0200)] 
lib/colors: add colormode_or_err()

... to make the code easy to use in utils.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoprlimit: delete rem_prlim prototype
Davidlohr Bueso [Sun, 5 May 2013 19:46:51 +0000 (12:46 -0700)] 
prlimit: delete rem_prlim prototype

We can just move the function up before any of its callers.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agodocs: note ddate removal
Mike Frysinger [Sat, 4 May 2013 04:49:34 +0000 (00:49 -0400)] 
docs: note ddate removal

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agodmesg: fix usage() typo
Sami Kerola [Thu, 2 May 2013 18:55:03 +0000 (19:55 +0100)] 
dmesg: fix usage() typo

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodmesg: support --color[={auto,always,never}]
Karel Zak [Mon, 6 May 2013 17:11:28 +0000 (19:11 +0200)] 
dmesg: support --color[={auto,always,never}]

Signed-off-by: Karel Zak <kzak@redhat.com>