Commit Graph

808 Commits

Author SHA1 Message Date
Pedro Ribeiro 5dd48fb28f raw: add NLS support
[kzak@redhat.com: - add setlocale(), ...
                  - remove tailing white spaces]

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-03 08:46:36 +02:00
Pedro Ribeiro 5044f6d7f0 mkfs.cramfs: several strings without gettext calls
Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-03 08:35:16 +02:00
Pedro Ribeiro e56644ca45 fsck.cramfs: add NLS support
[kzak@redhat.com: - add setlocale(), ...]

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-03 08:30:33 +02:00
Pedro Ribeiro 90d43eca4e elvtune: add NLS support
[kzak@redhat.com: - add missing setlocale(), ...]

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-03 08:22:50 +02:00
Karel Zak 7a451aa995 mount: mtab created multiple times with -a option
When /etc/mtab does not exist and mount is called with -a, for every
mount point that is mounted a root-fs record is added to mtab. This is
because get_mtab_info() sets the flag mtab_does_not_exist to 1 when it
doesn't find /etc/mtab. However, if it actually finds /etc/mtab, the
variable is not reset to 0. So on every subsequent call to
get_mtab_info() (as it is the case when mounting several mount points
with the -a option), mount will think that /etc/mtab does not exist,
even if it was created in the meantime by mount itself.

Reported-By: Jonas Kramer <jkramer@nex.scrapping.cc>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-01 00:34:52 +02:00
Karel Zak af17e0d170 losetup: missing EBUSY error hint message
old version:
 # losetup /dev/loop0 /foo.img
 # losetup /dev/loop0 /bar.img; echo $?
 2

new version:
 # losetup /dev/loop0 /foo.img
 # losetup /dev/loop0 /bar.img; echo $?
 losetup: /dev/loop0: device is busy
 2

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-30 13:16:50 +02:00
Karel Zak a063e16c5d login: fix compiler warning (int32 time() arg)
login.c: In function ‘dolastlog’:
login.c:1438  warning: passing argument 1 of ‘time’ from incompatible pointer type

Unfortunately, on-disk lastlog format is always 32bit, bits/utmp.h:

  struct lastlog
  {
  #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
     int32_t ll_time;
  #else
     __time_t ll_time;
  #endif

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-29 13:08:06 +02:00
Karel Zak 293889d084 fsck.cramfs: fix compiler warning
fsck.cramfs.c: In function ‘main’:
fsck.cramfs.c:676  warning: ‘length’ may be used uninitialized in this function

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-29 12:24:38 +02:00
Signed-off-by: Guan Xin 1069973afa umount: no checking mount point removal
No longer checks if mount point has been renamed or removed.
Linux reports EBUSY for these actions, so this check is redundant.

[kzak@redhat.com: - remove the check rather than "#if 0"
                  - remove unnecessary mnt_err2 stuff]

Signed-off-by: Guan Xin <guanx.bac@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-29 12:13:54 +02:00
Guan Xin feec8bd17e mount: fix typo
Signed-off-by: Guan Xin <guanx.bac@gmail.com>
2008-09-29 11:43:45 +02:00
Guan Xin 992283e8e4 umount: check for overlaid mounts
Linux cannot umount a device whose mount point is hidden by subsequent
mount(s). i.e. We must umount the devices associated to a mount point
in the reverse order of when they were mounted.  If umount was called
violating this rule, report error and exit.

Signed-off-by: Guan Xin <guanx.bac@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-29 11:38:06 +02:00
Karel Zak 6a0fbe2216 mount: add info about /proc/mounts to mount.1
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-29 11:04:59 +02:00
Karel Zak aa24a176ec mount: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-25 22:25:38 +02:00
Karel Zak bd9d9f05e6 chrt: add NLS support, clean error messages and return codes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-23 23:33:10 +02:00
Martin Steigerwald c779d6e94f chrt: support CFS SCHED_IDLE priority and document it
Signed-off-by: Martin Steigerwald <ms@teamix.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-23 23:28:00 +02:00
Karel Zak af53f0f1ca build-sys: add -luuid to BLKID_LIBS
The libblkid is always linked with libuuild, so this indirect
dependence in BLKID_LIBS is not a problem. This change helps to people
who compile util-linux-ng with non-standard prefix, ..etc.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-17 13:49:45 +02:00
maximilian attems 3342f88dec partx: don't redeclare daddr_t
klibc porting fix, use proper include, nuke redefinition.
solaris.c:8: error: redefinition of typedef ‘daddr_t’
/usr/lib/klibc/include/sys/types.h:29: error: previous declaration of ‘daddr_t’ was here

Signed-off-by: maximilian attems <max@stro.at>
2008-09-16 11:29:42 +02:00
Karel Zak f635c336c4 ipcmk: add NLS support
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-10 16:03:43 +02:00
Karel Zak cc41c0a33e ipcmk: fix error codes and error messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-10 16:00:17 +02:00
Hayden James 1b3f133043 ipcmk: new command
Small patch to create an application that can easily create ad-hoc ipc
resources, along with man page.

[kzak@redhat.com: - rename from ipccreat to ipcmk
                  - minor coding style changes]

Signed-off-by: Hayden James <hayden.james@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-10 15:36:50 +02:00
Karel Zak 030d18fd2a ionice: add strtol() checks, cleanup usage text and man page
* cleanup usage() output

 * check strtol(); don't ignore wrong command line options

The original ionice design was a little broken, because it was
possible to specify a PID and also a COMMAND:

	ionice -c2 -p 123 /bin/foo

but the command /bin/foo was executed without requested scheduling
class. That's stupid behaviour.

Now you have to use "-p PID" **or** COMMAND, but not both. Nothing is
ignored and all options are checked.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-06 14:54:01 +02:00
Stephan Maka ef0fe2e8aa ionice: let -p handle multiple PIDs
Makes ionice -p usable like renice, this time backwards compatible

[kzak@redhat.com: - fix coding style
                  - add ioprio_setpid()]

Signed-off-by: Stephan Maka <stephan@spaceboyz.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-05 16:18:14 +02:00
Karel Zak 53e9eda352 login: fix warning "dereferencing type-punned pointer will break strict-aliasing rules"
This patch fix problems with odd pam_get_iten( ..., void **) API.
(tested by gcc-4.1.2-42.el5.i386)

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-01 12:41:57 +02:00
Karel Zak 65158b1081 losetup: remove dependence on minor numbers
The latest kernel supports partitioned loop devices (kernel commit
476a4813cfddf7cf159956cc0e2d3c830c1507e3). Unfortunately, this change
makes minor numbers useless, because mirror number does not match with
loop device name (loop<N>).

We have to follow loop device names only.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-21 12:06:25 +02:00
Karel Zak 32b40fec8f fdisk: round reported sizes rather than truncate
Exmaples (-old, +new):

- Disk /dev/mapper/bar: 266.6 GB, 266666666496 bytes
+ Disk /dev/mapper/bar: 266.7 GB, 266666666496 bytes

- WARNING: The size of this disk is 2.1 TB (2199023255552 bytes).
+ WARNING: The size of this disk is 2.2 TB (2199023255552 bytes).

Reported-by: Stepan Kasal <skasal@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-20 23:27:50 +02:00
Benno Schulenberg 455824187a ipcs: adjust some field positions and widths for correct alignment
[kzak@redhat.com:
	- note that "ipcs -m -t" did not work correctly on
          terminal with 80 columns
	- the change of output alignment should be mentioned
          in the Release Notes]

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2008-08-20 22:37:10 +02:00
Benno Schulenberg 11658135af ipcs: ungettextize the spacing of the table headers
It makes no sense to allow translators to adjust the spacing when
they cannot adjust the spacing of the actual data too.  Adjusting
such spacing is not really a translator's task.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2008-08-20 15:16:02 +02:00
Karel Zak 3174598ae3 fdisk: don't check for GPT when asked for disk size only
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-19 13:54:38 +02:00
Karel Zak ee5355e005 fdisk: warn users about 2.2TB dos partition limit
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-19 13:53:28 +02:00
Karel Zak 1b414d8935 swapon: -a has to complain, fix leaks
The "swapon -a" command (without "-e" option) has to complain always
when LABEL or UUID does not exist.

Test:

	# grep foo /etc/fstab
	LABEL=foo swap swap defaults 0 0

   Old version:

	# swapon -a; echo $?
	0

   Fixed version:

	# swapon -a; echo $?
	swapon: cannot find the device for LABEL=foo
	255

	# swapon -a -e; echo $?
	0

This version also fix two memory leaks.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-19 01:22:02 +02:00
Karel Zak 27f9db17bd hwclock: don't open /dev/rtc repeatedly
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-18 14:08:57 +02:00
Karel Zak d92026e4c2 fdisk: remove obsolete information from man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-18 13:15:10 +02:00
Cai Qian c2abd9a0a5 lscpu: regression tests
This patch added regression tests for lscpu. It tests lscpu for 3
architecutres, i386, x86_64 and ia64, with data from 3 different
machines each.

Signed-off-by: Cai Qian <qcai@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-14 13:15:43 +02:00
Karel Zak 928e9f327f tests: detect libvolume_id when mount(8) is compiled
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-14 13:01:04 +02:00
Cai Qian 47b6e8b684 lscpu: --sysroot option and stable cache output
This patch added a --sysroot command-line option for testing purpose. It
also sorted cache names, and displayed cache information in a sorted
manner instead of randomly before. In addition, it had some other minor
fixes.

Signed-off-by: Cai Qian <qcai@redhat.com>
2008-08-14 12:22:29 +02:00
Karel Zak f4a94b4b2e docs: TODO update
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-14 11:48:26 +02:00
Karel Zak 5bd11d0d11 ionice: cleanup error messages, add NLS support
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-14 11:40:08 +02:00
Karel Zak 8eec9db243 ionice: cleanup man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-14 11:19:07 +02:00
Karel Zak 0c723f3490 scriptreplay: new implementation is out-of-sync
Reproduction steps:

1. Run "script -t 2>timing".
2. When the prompt comes up, hit return.
3. New prompt. Wait several seconds, then type "true" and hit return.
4. Repeat (3) as desired, then exit scripted shell.
5. Run "scriptreplay timing".

You'll find on the replay that, rather than waiting several seconds
between the prompt and true, the wait will actually occur after the
first "t" of true.

Reported-by: Micah Cowan <micah@cowan.name>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-13 11:54:13 +02:00
Karel Zak 55a4a75ca0 hwclock: read_hardware_clock_rtc() need to return error codes
We shouldn't ignore RTC_RD_TIME/RTCGET error codes.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-13 11:47:10 +02:00
Kalev Soikonen ac1bb1ef93 hwclock: delay loop in set_hardware_clock_exact
- Avoid delaying 1.5 seconds when 0.5 will do.
- Guard for forward time resets as well.

[kzak@redhat.com: - fix the "Delaying.." debug message
                  - add comments]

Signed-off-by: Kalev Soikonen <ksop@hot.ee>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-13 11:43:59 +02:00
Karel Zak 982a4a5d98 hwclock: use time limit for synchronization busy wait
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-13 11:43:59 +02:00
Karel Zak 3b96a7acbc hwclock: use carefully synchronize_to_clock_tick() return codes
* It seems that

	rtc-isl1208 0-006f: chip found, driver version 0.3
	rtc-isl1208 0-006f: rtc core: registered rtc-isl1208 as rtc0
	rtc-isl1208 0-006f: rtc power failure detected, please set clock.

  causes that hardware clock returns persistent time and synchronization
  is impossible. The hwclock(8) has to ignore this problem and allows to
  set clock anyway.

* synchronize_to_clock_tick() shouldn't to print the "...got clock tick"
  debug message in case of failure.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-13 11:40:23 +02:00
Karel Zak e8abdb3150 mount: add docs about utf8=0 for vfat
Addresses-Red-Hat-Bugzilla: #454354
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-12 14:58:50 +02:00
David Brownell 442d61c6e9 hwclock: remove x86_64-specific bogon
I was puzzled why "hwclock" wrongly reported my x86_64 sytem didn't
support RTC update interrupts.  Bogus #ifdef, that's why ... added
by the 2.11y patch (from 2.11t).  Probably this whole #ifdef should
just vanish ... if the kernel rejects UIE_ON, the program ought to
just cope with it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2008-08-12 12:50:11 +02:00
Arkadiusz Miskiewicz 9ea8ac3775 build-sys: tgets is not in ncurses but in tinfo
ncurses library can be build with terminal related functions
landing in separate libtinfo library. Check for ncurses function
when testing ncurses library existence.

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
2008-08-08 11:09:11 +02:00
Denis ChengRq b9ae48db4a sfdisk: print version should end with a newline
Signed-off-by: Denis ChengRq <crquan@gmail.com>
2008-08-08 11:08:18 +02:00
Karel Zak 28e984a419 hwclock: cleanup help output and man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-06 13:19:40 +02:00
Kalev Soikonen d458f94a7c hwclock: unshadow a diagnostic printf
- Bogus if test means one message is never produced.

- Avoid needless passing of a global variable (debug).

The --test option flag ought to be a global as well (and perhaps -n/--dry-run).

Signed-off-by: Kalev Soikonen <ksop@hot.ee>
2008-08-06 12:47:55 +02:00
Karel Zak f8d87ab139 rtcwake: cleanup return codes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-06 12:36:10 +02:00