Commit Graph

120 Commits

Author SHA1 Message Date
Karel Zak 56d23414c1 flock: fix printf format error in usage()
flock.c: In function ‘usage’:
flock.c:75: warning: too few arguments for format

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-11 13:37:45 +01:00
Karel Zak 841f86dbc2 flockc: segfaults when file name is not given
$ flock -s
Segmentation fault

ltrace:
__libc_start_main(0x8048870, 2, 0xbfe9f404, 0x8049070, 0x8049060 <unfinished ...>
getopt_long(2, 0xbfe9f404, "+sexnouw:hV?", 0x80494e0, 0xbfe9f354) = 115
getopt_long(2, 0xbfe9f404, "+sexnouw:hV?", 0x80494e0, 0xbfe9f354) = -1
strtol(0, 0xbfe9f34c, 10, 0x80494e0, 0xbfe9f354 <unfinished ...>
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

Addresses-Red-Had-Bugzilla: #489672
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-11 13:37:40 +01:00
Karel Zak 7cfbafda9c renice: add -n option for compatibility with POSIX
The -n option is required by POSIX.1-200x.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-09 21:09:50 +01:00
Karel Zak a0d4e9d91b rtcwake: add mising .RE to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-01-29 17:47:20 +01:00
Karel Zak 8e88e8fc1e rtcwake: explain supported modes in rtcwake.8
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-01-26 22:00:22 +01:00
Marco d'Itri e4b0fc36ff rtcwake: support not suspending
People usually want to use pm-utils to suspend the system instead of
the raw kernel interface, so I added an option to just exit after
configuring the wakeup time.
Actually I think that all the suspend code should be removed from
rtcwake, since it does not really belong there.

Signed-off-by: Marco d'Itri <md@linux.it>
2009-01-26 21:22:24 +01:00
Adam Jackson 11ea22d5a3 dmesg: Add -r (raw) option.
Useful for debugging which kernel messages are ruining your quiet
bootup.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2009-01-16 12:34:49 +01:00
Alexey Gladkov ff5717391c flock: Allow lock directory
With this patch, you can lock directory. Additionally,
lockfile opens with O_NOCTTY.

Try to open file with O_CREAT flag first, and without it
if open fails with EISDIR.  Suggested by H. Peter Anvin.

Signed-off-by: Alexey Gladkov <legion@altlinux.org>
2008-12-03 10:33:53 +01:00
Karel Zak 16cccfc19b rdev: cleanup includes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-11-26 14:40:03 +01:00
Karel Zak 1dabcd2498 pivot_root: clean up
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-11-19 12:40:06 +01:00
Karel Zak 5947572d5e build-sys: move pivot_root(8) to sys-utils
This patch moves pivot_root.{8,c) from mount/ to sys-utils/ directory.
There is not ant relation between pivot_root source code and the rest of
code in the mount.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-11-19 12:38:43 +01:00
Matthias Koenig cf474aacfc lscpu: return EXIT_SUCCESS at the end
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2008-10-22 23:35:19 +02:00
Karel Zak c8b64f6d77 lscpu: add Hypervisor detection
This patch adds two new fields:

 * "Hypervisor vendor"  -- based on CPUID and hypervisor specific
   PCI devices. lscpu(1) supports KVM, XEN, Microsoft HV now.

 * "Virtualization type"
	- "none"	= Xen dom0
	- "full"	= full virtualization (KVM, Xen, ...)
	- "para"	= Xen paravirtualization

Co-Author: Ky Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-22 13:56:52 +02:00
Karel Zak bf7b8d773b ipcs: fix exit codes, remove tailing white-spaces
Addresses-Red-Hat-Bugzilla: #465911
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-07 10:23:23 +02:00
Pedro Ribeiro 39a5a2314b readprofile: 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 09:27:33 +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
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
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 f8d87ab139 rtcwake: cleanup return codes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-06 12:36:10 +02:00
Gabriel Burt fc18118430 rtcwake: prefer RTC_WKALM_SET over RTC_ALM_SET
rtcwake: Prefer RTC_WKALM_SET over RTC_ALM_SET, fixing bug with not
waking up with new RTCs.  Also, return error if unable to set the alarm.

Signed-off-by: Gabriel Burt <gburt@novell.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-06 12:19:46 +02:00
Alexey Gladkov 8e678e2124 Fix dmesg.1 installation
Signed-off-by: Alexey Gladkov <legion@altlinux.org>
2008-08-05 12:25:59 +02:00
maximilian attems d144727bc3 use getpagesize()
getpagesize() is said to be more portable than sysconf(_SC_PAGESIZE)
to anything Linux.

this patch helps klibc porting effort as the sysconf
multiplex API is not supported there.

also remove comment of the switch to sysconf in mkswap.c.

Signed-off-by: maximilian attems <max@stro.at>
2008-07-30 13:26:58 +02:00
maximilian attems d3e8f6598b remove CVS keywords
this patch removes old CVS keywords from comments.

mount(8) works for newer Linux then 0.99 ;)

Signed-off-by: maximilian attems <max@stro.at>
2008-07-28 11:10:08 +02:00
maximilian attems 5423ccb1a1 dmesg: nuke old glibc 5 support
dmesg.c:42: error: expected declaration specifiers or ‘...’ before ‘klogctl’
dmesg.c:42: error: expected declaration specifiers or ‘...’ before ‘type’
dmesg.c:42: error: expected declaration specifiers or ‘...’ before ‘b’
dmesg.c:42: error: expected declaration specifiers or ‘...’ before ‘len’

without belows compat section dmesg just compiles fine against klibc.
as bonus reorder the includes.

Signed-off-by: maximilian attems <max@stro.at>
2008-07-28 11:06:50 +02:00
Samuel Thibault abd0b5686d ldattach: don't compile for non-linux systems
There is just ldattach which doesn't compile because line disciplines are not
implemented that way on the Hurd.  Is TIOCSETD any kind of standard?  Else I
guess the patch below would be fine.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2008-07-28 11:05:48 +02:00
Karel Zak a485aec8ce build-sys: cleanup sys-utils/Makefile.am
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-22 15:08:42 +02:00
Cai Qian 5dd7507c18 lscpu: new command
Add a lscpu(1) utility program.

[kzak@redhat.com:
	- indent by linux-2.6/scripts/Lindent
	- add lscpu.{c,1} to sys-utils/Makefile.am
	- add NLS suport
	- complete code refactoring
]

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Cai Qian <qcai@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-18 03:01:49 +02:00
Paulius Zaleckas 47bf8ef7f1 rtcwake: fix the default mode to "standby"
Writing "suspend" to /sys/power/state does nothing.
Even "man rtcwake" says that default should be "standby" :)

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-06-09 12:49:00 +02:00
Karel Zak 2d281745d9 setarch: add fallback for linux/personality
setarch.c:248: error: 'ADDR_NO_RANDOMIZE' undeclared (first use in this function)
setarch.c:248: error: (Each undeclared identifier is reported only once
setarch.c:248: error: for each function it appears in.)
setarch.c:251: error: 'FDPIC_FUNCPTRS' undeclared (first use in this function)
setarch.c:257: error: 'ADDR_COMPAT_LAYOUT' undeclared (first use in this function)
setarch.c:260: error: 'READ_IMPLIES_EXEC' undeclared (first use in this function)

Linux gzp1 2.4.36.1-gzp1 #1 SMP Tue Feb 19 10:23:48 CET 2008 i686 GNU/Linux

Reported-By: Gabor Z. Papp <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-05-13 14:00:39 +02:00
Dmitry V. Levin 3c52010c68 setarch: provide backwards compatibility
The getopt_long(3) use introduced by commit
8df90dec2b
broke backwards compatibility.

Old behavior:
$ i386 uname -m
i686

New behavior:
$ i386 uname -m
i386: invalid option -- m
Linux

Traditional method to fix it is to disable program arguments reordering
by prefixing getopt_long's optstring with '+' character.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-16 11:20:09 +02:00
Karel Zak 00077d4d53 build-sys: update .gitignore files
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14 14:24:03 +02:00
James Youngman c4e1583799 build-sys: ignore a bunch of generated files, mostly binaries
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14 14:08:00 +02:00
Karel Zak f8132752db ldattach: use glibc termios
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-09 11:48:24 +02:00
Karel Zak fcba457783 ldattach: add NLS support
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-03-25 22:59:47 +01:00
Tilman Schmidt 1e8d11c459 ldattach: new command
Add an ldattach(8) utility program similar to the one in OpenBSD.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
2008-03-10 14:20:26 +01:00
Mike Frysinger d3cf541492 rtcwake: fix typo SATE -> STATE
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-02-15 02:01:00 +01:00
Mike Frysinger c41e134067 rtcwake: include libgen.h for basename prototype
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-02-15 01:36:19 +01:00
David Brownell 1b7c164c49 rtcwake: fix UTC time usage
Timezone handling is broken in this version since it's always
passing UTC time into the kernel, even on systems where the
RTC uses the local timezone.

I think that bug must come from bugs in how the system used to
to originally develop this code handled the RTC timezone.  Both
RTCs should have been kept in UTC ... but only one of them was.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2008-02-08 01:33:39 +01:00
Karel Zak 6dd6d8687b ipcs: add information about POSIX compatibility to ipcs.1
Addresses-Suse-Bug: #274338
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-02-08 00:51:04 +01:00
LaMont Jones 628cab7cde renice: detect errors in arguments, add -v, -h and long options
* renice was using atoi(), which does no error detection, meaning
   that: "renice +20 blah" was accepted as valid.

 * add -h | --help

 * add -v | --version

 * add long options for -p, -u and -g

 * cleanup coding style

Addresses-Debian-Bug: #385245
Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: LaMont Jones <lamont@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-01-29 15:31:47 +01:00
Frédéric Bothamy 2dd88c0682 sys-utils: correct setarch.8 manpage link creation
At least on Debian, .so commands are relative to the man directory
(e.g., /usr/share/man), not to the subdirectory:
    % man i386
    man: can't open /usr/share/man/setarch.8: No such file or directory
    No manual entry for i386

See also http://bugs.debian.org/453245

Addresses-Debian-Bug: #453245
Signed-off-by: Frédéric Bothamy <frederic.bothamy@free.fr>
Signed-off-by: LaMont Jones <lamont@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-01-14 10:31:45 +01:00
Stepan Kasal 280ff4980c build-sys: simplify code around RDEV_LINKS and SETARCH_LINKS
Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-12-17 10:09:13 +01:00
Stepan Kasal d829a8df7e build-sys: use portable $(VAR:=) instead of gmake-specific $(addsuffix)
Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-12-17 10:09:03 +01:00
Stepan Kasal a3ca3a44c5 build-sys: use dist_man_MANS instead of man_MANS
Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-12-17 10:08:49 +01:00
Oliver Falk adf88e666a setarch: add missing alpha subarchs
Signed-off-by: Oliver Falk <oliver@linux-kernel.at>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-12-03 13:34:42 +01:00
David Brownell 2148b05182 rtcwake: misc cleanups
Cleanups for rtcwake:

  - Minor doc updates:  highlight the framebuffer problem,
    give correct history of this code
  - Improve debug output
  - Fix some linelength bugs

Note that this code predated the sysfs "wakealarm" mechanism, and
works around several now-fixed bugs in the kernel RTC framework.

Nowadays it would make sense to make this program use only the sysfs
interface to the RTC, using "since_epoch" instead of RTC_RD_TIME and
"wakealarm" instead of the four other ioctls.  That could simplify
the mess involved in timezone handling.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-12-03 13:29:47 +01:00
Samuel Thibault 3bbc932079 build-sys: non-linux support
Here is a patch that disables linux-specific tools on non-linux targets.

Signed-Off-By: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-Off-By: Karel Zak <kzak@redhat.com>
2007-11-08 02:26:36 +01:00