Commit Graph

3598 Commits

Author SHA1 Message Date
Petr Uzel 75aaee08f0 flock: make flock(1) work on NFSv4
To pleace an exclusive lock on a file, NFSv4 requires
the file to be opened RW because of the emulation of flock()
by fcntl():

http://www.spinics.net/lists/linux-nfs/msg18502.html

So instead of O_RDONLY, open the file in O_RDWR if access()
indicates it is possible (unless shared lock is requested).

From: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2011-10-18 14:22:27 +02:00
Karel Zak 099945d1f7 agetty: test ECHO on c_lflag
Reported-by: xinglp <xinglp@gmail.com>
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=739522
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:27 +02:00
Karel Zak 9e66fb3116 mount: check for target before source on remount
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=737091
Reported-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:27 +02:00
Petr Uzel 718d3b9814 lib: do not attempt to close(0) in sysfs_deinit()
If the 'open' fails we 'goto err' which runs 'sysfs_deinit()' on a 'cxt'
which hasn't been fully initialised. The 'dir_fd' is still 0, so
sysfs_deinit calls "close(0)".

Addresses: https://bugzilla.novell.com/show_bug.cgi?id=714151
Reported-by: Diego Ercolani <diego.ercolani@gmail.com>
Analysed-by: Neil Brown <nfbrown@suse.com>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2011-10-18 14:22:27 +02:00
Karel Zak 0f96058686 blkid: potential null derefence [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:27 +02:00
Karel Zak 5bc520a5ce kill: potential null derefence [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:27 +02:00
Karel Zak f8e57433f7 libmount: potential null derefence [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:27 +02:00
Karel Zak 5ea62c4b79 libmount: variable dereferenced before check [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:27 +02:00
Karel Zak 3a8652ec2e libmount: redundant null check on calling free() [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:26 +02:00
Karel Zak bce431ceda libmount: use unsigned int for bitfields [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:26 +02:00
Karel Zak 578dbc5749 include,c.h: include fcntl.h before check for O_CLOEXEC [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:26 +02:00
Francesco Cosoleto 2e021f76fc fdformat: fix uninitialized variable
Spotted by EKOPath compiler.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2011-10-18 14:22:26 +02:00
Sami Kerola 261ea7865a build-sys: ddate typo fixed
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-10-18 14:22:26 +02:00
Heiko Carstens 66c200adbc lscpu: allow read_cache() to be called for offline cpus
First check path before accessing files to be sure they actually exist. This is
necessary when also informations for offline CPUs will be printed.  Since we do
not necessarily know if "cpu is offline" means the same as "path does not
exist" just check for it.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-10-18 14:22:26 +02:00
Heiko Carstens 4f02e85bea lscpu: simplify cache column output function
Simplify the logic to "always print a ',' for each cache except if it is the
last one.  This is also a preparation patch for printing the cache column for
offline CPUs where it would print one colon too much because of the current
logic.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-10-18 14:22:26 +02:00
Heiko Carstens 1c336d735f lscpu: fix cache output for extended parsable output
The extended parsable output prints a colon instead of comma between each
item. The case where a CPU doesn't belong to any cache was not converted.
Just fix this.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-10-18 14:22:26 +02:00
Heiko Carstens 687b4a06a1 lscpu: remove comma operator
Fix typo where the comma operator has been introduced.
Use a semicolon instead so we end up with simple assignment expressions.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-10-18 14:22:26 +02:00
maximilian attems f57d96050d libuuid: add limits.h include for OPEN_MAX
Needed as definition for usage in close_all_fds().
Noticed on klibc build.

Signed-off-by: maximilian attems <max@stro.at>
2011-10-18 14:22:26 +02:00
Karel Zak c026835006 agetty: double equals sign typo in opentty()
Reported-by: Francesco Cosoleto <cosoleto@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:26 +02:00
Natanael Copa d037712724 script: fix building with --disable-nls
We should only include the libintl.h when NLS is requested.

This fixes issue when building util-linux with uClibc.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:26 +02:00
Karel Zak 8c3b3cb11f write: fix path for freopen()
Reported-by: xinglp <xinglp@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:26 +02:00
Karel Zak ed6de6f7ac dmesg: remove extra space only after time stamp
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:26 +02:00
Karel Zak 980048bf84 build-sys: remove redundant __progname check
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:26 +02:00
Karel Zak 7a8e6f9ce6 dmesg: fix for non-CONFIG_PRINTK_TIME kernels
* dmesg(1) incorrectly assumes that lines like "<6>\n"
   are broken.

 * it's more robust to assume the end of the record is "\n<"

 * print \n for empty lines

Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:22:26 +02:00
Heiko Carstens 04c36ce9d9 lscpu: use hypervisor generated topology information
The readable output prints also informations like cores per socket etc.
On newer kernel versions on s390 this information is available via
/proc/sysinfo. However it does not contain the layout of the guest but
the layout of the real machine.
Nevertheless this is better than random guessing with completely broken
numbers like we have it now on s390. If the information is not available
we fall back to old mechanism with more or less random numbers.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 14:17:01 +02:00
Heiko Carstens d94f62fe46 lscpu: fix fallback nthreads calculation
The fallback calculation of nthreads did not consider books.
In order to avoid division/multiply by/with zero make sure each number
used is at least "1".

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-10-18 07:12:41 +02:00
Heiko Carstens 0ee7da4d80 lscpu: fix cpu map array sizes
Completely virtualized architectures like s390 may have multiple
virtual sockets and/or cores where each of them has a different
number of cores and cpus.
So the general assumption within the allocation scheme that e.g.
each socket contains the same number of cores is not necessarily
true. To make sure the arrays are always large enough we simply
allocate enough memory so that each array could hold cpu masks
for all present cpus.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-10-18 07:12:17 +02:00
Heiko Carstens d25ad908fd lscpu: fix s390 bogomips detection coding style
Just make the s390 bogomips detection line look like all others.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-10-18 07:11:22 +02:00
Petr Uzel 0e31d4dfe9 sfdisk.8: fix formatting
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2011-10-18 07:09:02 +02:00
maximilian attems c2aa7c491c raw: fix shadowing of minor function
Noticed while compiling against klibc:
raw.c: In function ‘query’:
raw.c:219:16: error: called object ‘minor’ is not a function

Rename variable from minor to minor_raw.
While at it mark the functions as static and small whitespace fixes
as asked by checkpatch.

[kzak@redhat.com: - rename variable at line 241 too]

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 07:08:49 +02:00
Karel Zak 5c8e3d2745 build-sys: don't install ru/ddate.1 if ddate disabled
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-18 07:08:27 +02:00
Karel Zak 60a5833b64 build-sys: release++ v2.20
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-29 13:03:13 +02:00
Karel Zak 79e1e38b9f docs: update v2.20 ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-29 13:03:03 +02:00
Karel Zak 9f4b8463bb docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-29 12:29:46 +02:00
Karel Zak eaafb8f363 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-29 12:23:30 +02:00
Jakub Bogusz 006a5ecfbf po: update pl.po (from translationproject.org) 2011-08-29 12:13:10 +02:00
Benno Schulenberg 2f94f13cf4 po: update nl.po (from translationproject.org) 2011-08-29 12:13:10 +02:00
Takeshi Hamasaki 9841626a97 po: update ja.po (from translationproject.org) 2011-08-29 12:13:10 +02:00
Philipp Thomas 5853a96b8e po: update de.po (from translationproject.org) 2011-08-29 12:13:10 +02:00
Petr Písař 46e1a17e1b po: update cs.po (from translationproject.org) 2011-08-29 12:13:10 +02:00
Karel Zak 9830eca533 lsblk: add note to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-29 11:34:10 +02:00
Benno Schulenberg 449a215fc5 docs: tweak the formatting and wording of several disk-utils man pages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-29 11:24:47 +02:00
Benno Schulenberg 530395f2d5 ionice: adjust synopsis and wording and formatting on the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-29 11:24:45 +02:00
Benno Schulenberg c5f29f2382 look: adjust the formatting and some wording of the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-29 11:24:44 +02:00
Benno Schulenberg 6e7a408dda vipw: (man page) uniformize header and footer, tweak the formatting
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-29 11:24:43 +02:00
Benno Schulenberg 5bcd986ed3 docs: tweak the formatting and wording of some text-utils man pages
Highlight the program name, use proper lowercase, remove
unneeded commas and articles, and add helpful hyphenation.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-29 11:24:41 +02:00
Benno Schulenberg 62246430f3 docs: also uniformize headers and footers of troff-formatted man pages
Add two spaces as the required third argument of the date line to make
the specified date get used instead of today's date.  Incorporate the
section number into the page title, then use an empty section number,
so that specifying an explicit section/volume name will work.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-29 11:24:39 +02:00
Ben Hutchings 70eebc40e2 setarch: add --uname-2.6 option for personality flag UNAME26
[kzak@redhat.com: - minor change in usage()]

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-29 11:16:25 +02:00
Karel Zak 36908f176f flock: fix example in man page
Reported-by: Pierre Gaston <pierre.gaston@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-29 11:05:41 +02:00
Karel Zak 581a4ad92a libmount: fix debug message
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-26 10:49:38 +02:00