Commit Graph

2869 Commits

Author SHA1 Message Date
Sami Kerola e89c3891a5 wall: add long options and 79 char cut info to the man page
Mention that over 79 characters long lines are cut, while long
options is an obvious change.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-12 11:29:13 +02:00
Sami Kerola 5e6bf8008b ttymsg: fix compiler warnings and use EXIT_
[kzak@redhat.com: - remove 'register' storage class specifier]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-12 11:19:15 +02:00
Sami Kerola 76cc41b7fb wall: use long options
Also --version & --help options added, and rewrote help output.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-12 11:12:17 +02:00
Sami Kerola 98e2d4deb3 wall: remove global variables and support TMPDIR
The TMPDIR environment is preferred over _PATH_TMP in which a
file is created that is ultimately sent to terminals. This patch
will also fix compiler warnings and removes magical numbers,
which has not explanation.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-12 11:09:42 +02:00
Karel Zak ca6182333e mount: add note about blank lines to fstab.5
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=694648
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-12 10:05:25 +02:00
Karel Zak 531019d5c3 umount: support non-canonical devnames in mtab
Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/755193
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-11 14:05:57 +02:00
Karel Zak 7312c4ad18 docs: update TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-08 10:15:06 +02:00
Karel Zak 9497ebb074 setterm: use xmalloc()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-06 11:24:23 +02:00
Sami Kerola 172ba4f2a8 setterm: fix variable types, and unused argument warnings
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 11:21:48 +02:00
Sami Kerola 9350520053 setterm: add note about long dump file paths to man page
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 11:20:48 +02:00
Sami Kerola a973947c88 setterm: function screendump coding style fixed
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 11:19:15 +02:00
Sami Kerola 6e8e22adf6 setterm: mention in man setterm.1 -version and -help switches
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 11:15:15 +02:00
Sami Kerola 261f1423fb setterm: use libc error printing facilities
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-06 11:13:40 +02:00
Sami Kerola faa0548de4 setterm: support -help and -version options
[kzak@redhat.com: - merge all options to the one string]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-06 11:10:34 +02:00
Sami Kerola 2971543625 setterm: segfault with long dump file name
The patch will make too long path to be truncated to MAX_PATH
lenght. If user supplies too long file name that is caught at
fopen. Some users might find this unintuitive, so the altered
behavior will be mantioned in manual page.

Bug in earlier version was visible with a command bellow.

setterm -dump -file $(for i in $(seq 254); do printf x ; done)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 10:59:17 +02:00
Sami Kerola a29e40cad5 column: use xalloc lib
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 10:59:17 +02:00
Sami Kerola 07dcb82d06 rev: mention long options in man page
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 10:59:06 +02:00
Sami Kerola ca96c6ac52 rev: option parsing bug fixed & long options added
The former getopts segment gave impression unknown options will
cause the program to exit with error and help is available with
-h. Neither work quite as designed, all unknown options made the
program to exit with success; and none of the options where
known.

The fix also has support for long options, and new --version
switch.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 10:48:35 +02:00
Sami Kerola 2226064c52 rev: memory leak fix
Moving the malloc out of loop will make leak to disappear, and
the command might run few jiffie quicker when there are 1+N
arguments.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 10:45:02 +02:00
Sami Kerola 099bce7f5d rev: use xrealloc from xalloc.h
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 10:44:59 +02:00
Davidlohr Bueso 1d6a5daa58 partx: trivial comment fix
Replace atgv for argv

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-04-06 10:37:16 +02:00
Olivier Mengué 0a626987e2 getopt: add static qualifiers
Signed-off-by: Olivier Mengué <dolmen@cpan.org>
2011-04-06 08:33:49 +02:00
Karel Zak 488c033f2a build-sys: remove check-news
I need to call "make distcheck" often during development phase to check
that all files are correctly added to Makefiles. The "check-new"
automake option is useless if $(VERSION) is generated from git.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-05 16:38:06 +02:00
Sami Kerola 38c75b59e3 build-sys: use git-version-gen to distinct git and release versions
The script is copied as is from gnulib.

[kzak@redhat.com: - generate .tarball-version and .version files in
                    top level Makefile.am
                  - delete autom4te.cache in autogen.sh]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-05 16:34:00 +02:00
Karel Zak fb9d90d552 libmount: fix parsing of mountinfo from 2.6.39
The /proc/self/mountinfo file uses " - " field as a separator between
optional fields and next fields in the file. The '-' char could be
used in the fields (for example in UUIDs), so it's necessary to check
for whole " - " string rather than for '-' char only.

Reported-by: "Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-05 14:17:51 +02:00
Karel Zak c738bc32a4 build-sys: fix distcheck for term-utils
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-04 10:53:07 +02:00
Karel Zak 2a1d943dab libmount: add mountpoint(1) implementation to samples/ 2011-04-01 14:17:51 +02:00
Karel Zak f19c952b2f umount: use helper= for all UIDs
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-01 09:03:39 +02:00
Karel Zak a362ae601a libmount: support /run/mount rather than /dev/.mount
The /run directory should be preferred on distributions where this
directory exists.

http://thread.gmane.org/gmane.linux.redhat.fedora.devel/146976

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 21:26:57 +02:00
Karel Zak cafeed6724 tests: add dump from PPC64 to lscpu tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 14:47:45 +02:00
Karel Zak c487c90ccd lscpu: detect sun4{u,v} in /proc/cpuinfo for sparc64
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 14:30:06 +02:00
Karel Zak 2b9ced6859 tests: add dump from UltraSparc T1 to lscpu tests
Thanks to Jan Engelhardt.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 14:12:35 +02:00
Karel Zak fa043039e9 tests: add dump from huge ia64 to lscpu tests
Thanks to Jan Engelhardt.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 14:11:26 +02:00
Karel Zak 4e740fd81a lscpu: fix op-mode for /{sys,proc} dumps
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 13:09:50 +02:00
Karel Zak e282eec2a2 lscpu: fix threads-per-core calculation
On Thu, Mar 24, 2011 at 01:45:34PM +0100, Jan Engelhardt wrote:
> On a 24-thread/6-core SPARC T1, lscpu would wrongly output "5
> threads per core".
>
> It seems that the 6c T1 is simply an 8c T1 where 2c are disabled
> (offering a lesser model for a lower price, and all that marketing
> fluff). So the machine description header of the 6c T1 reports 32
> threads, but only goes on to provide 24 elements thereafter, which
> is why Linux will report threads 24-31 as "offline". So far so good.
>
> But lscpu would take the number of all (online and offline) threads
> (32) and divides it by the number of online cores (6), which yields
> an odd 5.33 threads/core.
>
> Simply pick the number of online threads.

Based on Jan's patch.

Reported-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 12:55:13 +02:00
Karel Zak f0fc846a53 login: fix checktty test to compile with old glibc
Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 11:39:01 +02:00
Petr Uzel b192b7b9a6 libmount: plug memory leak in sample program
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 00:05:01 +02:00
Petr Uzel 6ad929bbac libmount: fix some typos and copy&paste mistakes in comments
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2011-03-31 00:01:33 +02:00
Karel Zak 2b6bd96f2b libmount: fix memory leak in cache
Reported-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 23:52:56 +02:00
Karel Zak 4b658e0997 libmount: add phelper= support
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 15:40:56 +02:00
Karel Zak afa2dd4215 mount: add phelper=
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 14:56:33 +02:00
Karel Zak 6f5788c592 libmount: small lock code cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 13:58:04 +02:00
Karel Zak 66bb826710 libmount: use chdir() and NOFOLLOW umount flag for umount operation
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 13:00:03 +02:00
Karel Zak a2c90d998e libmount: fix test
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 12:39:24 +02:00
Karel Zak 701b48cf01 libmount: cleanup umount code
This patch removes obsolete stuff. The minimal requirement for
libmount umount code is Linux >= 2.4.11.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 11:30:23 +02:00
Karel Zak 5976114f62 libmount: block signals when writing to mtab
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 09:30:05 +02:00
Karel Zak 1bc386e513 docs: update TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 00:27:29 +02:00
Karel Zak 94b7e03d4f docs: update TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-30 00:10:00 +02:00
Sergey Gusarov 305a612251 blkid: small fix for safe_print()
This small fix makes it possible to print the first unprintable character
with code 128 from ASCII table.

Signed-off-by: Sergey Gusarov <laborer2008@gmail.com>
2011-03-29 17:07:24 +02:00
Karel Zak b7cdab2a47 umount: use UMOUNT_NOFOLLOW for non-root users
The UMOUNT_NOFOLLOW umount2() flag is supported since kernel 2.6.34.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-29 17:01:59 +02:00