Commit Graph

2323 Commits

Author SHA1 Message Date
Marek Polacek 9b59ecf082 vipw: use EXIT_* and err()
[kzak@redhat.com: - fix one error message]

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 15:57:17 +01:00
Marek Polacek 84228d125e simpleinit: Use EXIT_*
[kzak@redhat.com: use the main() part of the patch]

Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 15:52:44 +01:00
Marek Polacek 713e0eeed4 shutdown: Use EXIT_*
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 15:48:21 +01:00
Davidlohr Bueso ded850dfb8 docs: update TODO file
Here's a patch to update some the TODO list now that the new partx is
merged.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-12-10 14:08:53 +01:00
Karel Zak 11784a8442 login: fix "ignoring return value" errors
login.c:542:8: warning: ignoring return value of ‘fchown’, declared
with attribute warn_unused_result
login.c:1013:11: warning: ignoring return value of ‘fchown’, declared
with attribute warn_unused_result
login.c: In function ‘dolastlog’:
login.c:1452:7: warning: ignoring return value of ‘write’, declared
with attribute warn_unused_result
login.c: In function ‘motd’:
login.c:1391:7: warning: ignoring return value of ‘write’, declared
with attribute warn_unused_result

Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 14:05:27 +01:00
Marek Polacek 66020e56d2 login: use EXIT_* and err.h, clean up return codes
[kzak@redhat.com: - cleanup return codes
                  - use warn()]

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 13:52:37 +01:00
Marek Polacek db797f24f1 last: Use EXIT_* and err()
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
2010-12-10 13:18:12 +01:00
Karel Zak 3851ebe8f8 login: use EXIT_* in checktty()
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 13:08:33 +01:00
Karel Zak d39d4bf6f5 chsh: use EXIT_* and err.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 13:01:05 +01:00
Karel Zak f30f2bbc81 sfdisk: add option to use maximum partition size
Based on patch from Alex Bligh <alex@alex.org.uk>, Alex wrote:

   By default, omitting a size parameter means that the maximum sized partition
   is used. However, this option is not available in conjunction with the -N
   flag, as under such circumstances the default is the current size of the
   partition. This patch allows a size to be specified as "+" in which case
   the maximum sized partition is used, irrespective of the setting of the -N
   flag.

   This allows partitions to be programatically resized to their maximum size,
   by (for instance):

     echo ",+," | sfdisk -N1 /dev/sda

   This is non-trivial to do without the patch, as -N makes the default size
   the existing size. As there is (without this patch) no way of reading the
   maximum size, the only option is to delete the partition and recreate it.
   This is undesirable for a number of reasons (e.g. errors between delete
   and recreate).

Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/686124
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-09 23:13:58 +01:00
Francesco Cosoleto 8aa5046647 renice: improve messages specifying what ID is referring to
Hello,

On 30/11/2010 13:01, Karel Zak wrote:

> Unfortunately, translators don't like this kind of strings where any
> translatable substring is inserted to the normal sentence. It would be
> better to use something like:
>
>   "%d (%s): failed to set priority", who, idtype
>
>   "%s: %d: failed to set priority", idtype, who
>
> or so...

or "failed to set priority for %d (%s)"?

From 536eb11f873f2c887e075a37ffb3c971cac258d5 Mon Sep 17 00:00:00 2001
From: Francesco Cosoleto <cosoleto@gmail.com>
Date: Mon, 6 Dec 2010 01:23:10 +0100
Subject: [PATCH] renice: improve messages specifying what ID is referring to

This version makes more clear the printed message specially when the
--user option is used.

Old version:
   $ renice 19 10 -u fra -g 1
renice: 10: setpriority: Operation not permitted
renice: 1000: setpriority: Operation not permitted
renice: 1: setpriority: Operation not permitted

   $ renice 19 -u fra
1000: old priority 0, new priority 19

New version:
   $ renice 19 10 -u fra -g 1
renice: failed to set priority for 10 (process ID): Operation not permitted
renice: failed to set priority for 1000 (user ID): Operation not permitted
renice: failed to set priority for 1 (process group ID): Operation not permitted

   $ renice 19 -u fra
1000 (user ID) old priority 0, new priority 19

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2010-12-09 23:07:41 +01:00
Karel Zak 0742ce4ae5 partx: tiny change in usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-09 23:00:33 +01:00
Karel Zak 5de966b34b partx: cleanup and add columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-09 22:58:12 +01:00
Davidlohr Bueso 9894961bf9 tests: add regression tests
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-09 22:56:55 +01:00
Karel Zak 6e6a182ebd delpart: code consolidation
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-09 21:56:22 +01:00
Karel Zak 74a782e2a2 addpart: code consolidation
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-09 21:56:13 +01:00
Davidlohr Bueso c4ecaf21d5 partx: complete rewrite
Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-09 21:54:17 +01:00
Karel Zak 4bfa39d5d5 mount: be more explicit about --move in mount.8
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-06 11:17:10 +01:00
Karel Zak 728d2faafd libblkid: NTFS volume label not found
Reported-by: Hugh Eaves <hugh@hugheaves.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-03 15:27:30 +01:00
Karel Zak 7a15536c95 ipc: remove .info file
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-03 13:02:40 +01:00
Karel Zak ea6833c0aa build-sys: add mesg to .gitignore
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-02 18:07:57 +01:00
Marek Polacek 365210fc53 agetty: Use EXIT_* and add noreturn attribute
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
2010-12-02 18:07:07 +01:00
Marek Polacek 1a68fc8aef mesg: Use EXIT_* and discard K&R style declaration.
[kzak@redhat.com: - use return rather than exit() in main()
                  - more verbose error messages]

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-02 17:48:29 +01:00
Marek Polacek 1fa30199c6 newgrp: Use err() and EXIT_*
Use err() or errx() where appropriate.  Also use EXIT_* macros instead
of 0/1.  All error messages shall start with lowercase.

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-02 17:15:51 +01:00
Davidlohr Bueso 1b7cfdb631 README: fix typo
Change feture for feature

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-12-02 17:01:46 +01:00
Karel Zak db3b5b76a7 mount: read /sys for loopdev backing file
On systems without /etc/mtab (or everywhere if kernel >= 2.6.37)
we use loop autoclear flag and then the backing file name is not
stored in /etc/mtab. mount(8) uses sysfs to get the filename (or
LOOP_GET_STATU* ioctls on old kernels).

Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-01 23:02:17 +01:00
Karel Zak d3b24397df remove -ng from some files
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-01 22:06:15 +01:00
Karel Zak b61e939013 losetup: use /sys/dev/block/.../loop/backing_file
The basic loopdev attributes are available in sysfs since kernel
2.6.37. This patch uses the backing_file attribute from sysfs for very
long filenames (the LOOP_GET_STATUS ioctl uses only 64 bytes for the
filename).

old version:
 # losetup -a
 /dev/loop0: [0804]:12865322 (/home/images/filesystems/this_is_really_really_long_directory_*)

new version:
 # losetup -a
 /dev/loop0: [0804]:12865322 (/home/images/filesystems/this_is_really_really_long_directory_name/ext2.img)

Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-01 14:04:35 +01:00
Karel Zak 80dde62f9c lscpu: use GPLv2+
CAI Qian and I agree that GPLv2+ is better for lscpu.c. This license
is more compatible (than v3) with the rest of the util-linux package.
We need to link the code with functions from lib/ -- mix GPLv3 and
GPLv2 is bad idea.

Note that it was only Cai and I who did significant changes to
lscpu.c, all others changes from others developers was trivial (fix
typos, add _(), ...).

Signed-off-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-01 11:20:45 +01:00
Karel Zak a4f4cc7527 docs: update TODO file
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-30 13:28:46 +01:00
Davidlohr Bueso eecb3c83ce last: use xalloc lib
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-11-30 13:18:18 +01:00
Davidlohr Bueso 3e31a2dfaf login: use xalloc lib
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-11-30 13:18:18 +01:00
Davidlohr Bueso 4b5156cbfa wall: use xalloc lib
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-11-30 13:18:18 +01:00
Karel Zak 296351b0f1 renice: rewrite usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-30 12:46:06 +01:00
Francesco Cosoleto 5156840aa4 renice: update man page (nice rlimit was added to kernel)
Non-root tasks can raise nice priority on systems running Linux 2.6.12 or higher
if the nice resource limit is set.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2010-11-30 12:28:17 +01:00
Francesco Cosoleto 40cebc2d6f renice: reverse %s position in error messages
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2010-11-30 12:28:17 +01:00
Francesco Cosoleto 83fa126b93 renice: remove hardcoded program name using warn() and warnx()
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2010-11-30 12:28:17 +01:00
Francesco Cosoleto 22e0d3ec97 renice: make some functions static 2010-11-30 12:28:17 +01:00
Karel Zak 772a37940c po: fix note about license
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-30 11:56:03 +01:00
Karel Zak 43bc1a1ba4 build-sys: add missing header
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-30 11:52:10 +01:00
Karel Zak 4ded9dfb2a po: update after rename
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-30 11:48:14 +01:00
Karel Zak 601d12fb10 rename util-linux-ng back to util-linux
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-30 11:41:59 +01:00
Karel Zak 5a16af58c5 libblkid: add LINHIB0001 signature to swap prober
The new swsuspend signature has been added by commit
3624eb04c24861ab296842414f9752a393e68372 to kernel 2.6.37-rc1.

Reported-by: "Dr. David Alan Gilbert" <linux@treblig.org>
Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/682176
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-30 10:12:00 +01:00
Karel Zak c59773420c fdisk: fix freespace boundaries calculation on SGI disklabel
Thanks to Aurelien Jarno <aurelien@aurel32.net>

Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=510130
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-29 14:02:56 +01:00
Karel Zak e3d61a4579 fstrim: fix typo
Reported-by: Jeroen Oortwijn <oortwijn@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-29 13:09:16 +01:00
Mike Frysinger 2a7f8a8b7b libblkid: remove unnecessary __UCLIBC__ check
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-29 13:03:23 +01:00
Karel Zak 07b336c92e rtcwake: use err.h routines
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-26 17:43:54 +01:00
Marek Otahal fcf6729430 rtcwake: add 'show' mode for rtc alarm
The 'show' mode prints information on current alarm setting.

[kzak@redhat.com: - code clean up
                  - don't setup alarm on 'disable' mode]

Signed-off-by: Marek Otahal <markotahal@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-26 16:47:38 +01:00
Lukas Czerner d9e2d0dd14 fstrim: add new command
fstrim is used on a mounted filesystem to discard (or "trim") blocks
which are not in use by the filesystem.  This is useful for
solid-state drives (SSDs) and thinly-provisioned storage

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-26 14:59:01 +01:00
Karel Zak 6d830ab641 libblkid: 256MiB is min size of btrfs
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-26 14:39:32 +01:00