Commit Graph

1515 Commits

Author SHA1 Message Date
Karel Zak 8a2045620e lsns: new command
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-26 14:09:45 +01:00
Casper Ti. Vector e52b58e627 ctrlaltdel: use reboot() provided by libc, assuming it is 1-adic. 2015-11-19 12:07:04 +01:00
Karel Zak f98d9641a3 losetup: clean up --direct-io
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-19 11:57:05 +01:00
Ming Lei faeef4d2e9 losetup: support list direct io
So that user can see if DIO is set for current loop device.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
2015-11-19 11:27:36 +01:00
Ming Lei 64c3bb3cb7 losetup: support ioctl cmd of LOOP_SET_DIRECT_IO
From v4.4, linux kernel starts to support direct I/O and
AIO to backing file for loop driver, so allow losetup to
enable the feature by using LOOP_SET_DIRECT_IO ioctl cmd.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
2015-11-19 11:27:36 +01:00
Benno Schulenberg 25b3c04f41 lsipc: tweak a few wordings on the manpage
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-11-09 10:03:58 +01:00
Benno Schulenberg 239610b659 dmseg: slightly improve punctuation and formatting of the manpage
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-11-09 10:03:58 +01:00
Sami Kerola a4aeb5bd80 script, hwclock: check file exist with access(3) rather than stat(3)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-09 09:56:14 +01:00
Sami Kerola 8df370d340 swapon: fix stat(3) and open(3) race
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-09 09:56:14 +01:00
Karel Zak 803172f63d prlimit: cleanup output units
The change is based on kernel fs/proc/base.c.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-05 18:59:00 +01:00
Karel Zak 741d478eeb ctrlaltdel: use path.h to read /proc
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-27 11:56:51 +01:00
Sami Kerola 82cac34889
ctrlaltdel: display setting when ran without arguments
This is more useful than printing an error.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-18 18:03:57 +01:00
Sami Kerola 6e82b1f3ef
docs: update ctrlaltdel.8 man page
Most significant clarification is to tell hard C_A_D is the default in linux
kernel.  Update also kernel reference, and improve readability.

Reference: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/reboot.c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-18 18:03:52 +01:00
Sami Kerola 8137c98f83
ctrlaltdel: improve error messaging
Tell user what is wrong rather than print usage().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-18 18:03:47 +01:00
Karel Zak 1cd9d0d746 mount, umount, swapon, fsck, lsblk, findmnt: ignore malformed lines
The libmount provides way how to deal with parsing errors in fstab --
on error callback function is executed and according to the return
libmount manipulate with the malformed line, possible are three
states:

  1/ fatal error; all file ignored              (callback rc < 0)
  2/ recoverable error; malformed line ignored  (callback rc > 0)
  3/ ignore the error                           (callback rc == 0)

The 2/ is the default if no callback specified.

Unfortunately our utils uses 3/. The correct way is to use 2/.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-15 12:01:48 +02:00
Karel Zak b97edfe731 build-sys: use REALTIME_LIBS
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-09 11:31:49 +02:00
Karel Zak 1ceb4077af zramctl: fix lists of the all devices
The command zramctl lists the same stat info for all devices (DATA COMPR TOTAL).

Reported-by: Oliver Freyermuth <o.freyermuth@googlemail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-24 12:46:21 +02:00
Karel Zak 53650755e0 ipcs: fix ipc_sem_get_limits()
Reported-by: https://github.com/AndrewIrcha
Addresses: e5995acda2 (commitcomment-13200369)
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-15 09:50:08 +02:00
Andreas Henriksson e8c0003481 hwclock: fix format warning in alpha code
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2015-09-07 08:50:39 +02:00
Karel Zak 2eca78be47 mount: remove XFS from man page, xfsprogs provides xfs(5)
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-02 10:56:24 +02:00
Karel Zak e03b613e8d lscpu: fix read_hypervisor_powerpc() logic
We care about /proc/device-tree/compatible content...

The patch also removes unnecessary path_exist(), it seems good enough
to call open() rather than access() + open().

Addresses: https://github.com/karelzak/util-linux/issues/218
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-01 12:37:18 +02:00
Karel Zak 0a9e11af22 Merge branch 'master' of https://github.com/yurchor/util-linux
* 'master' of https://github.com/yurchor/util-linux:
  Fix trivial typos
2015-08-26 10:52:49 +02:00
Yuri Chornoivan 75a8e726e9 Fix trivial typos 2015-08-25 20:02:53 +03:00
Karel Zak 3a131296d1 dmesg: highlight -T issues in docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-25 15:43:03 +02:00
Karel Zak 049bfa066c fallocate: fix error message
FALLOC_FL_KEEP_SIZE flag is generic and used in many situations,
"-n" in the error message does not make sense.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1146152
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-25 15:34:09 +02:00
Andreas Henriksson 3baf5ac739 hwclock: fix iopl implicit declaration warning on alpha
Build warning:
sys-utils/hwclock-cmos.c: In function 'i386_iopl':
sys-utils/hwclock-cmos.c:611:9: warning: implicit declaration of function 'iopl' [-Wimplicit-function-declaration]
  return iopl(level);
         ^
sys-utils/hwclock-cmos.c:611:2: warning: nested extern declaration of 'iopl' [-Wnested-externs]
  return iopl(level);
  ^

Also:
checking sys/io.h usability... yes
checking sys/io.h presence... yes
checking for sys/io.h... yes

Full build log:
https://buildd.debian.org/status/fetch.php?pkg=util-linux&arch=alpha&ver=2.26.2-9&stamp=1440078034

Detected by/via:
https://qa.debian.org/bls/packages/u/util-linux.html

Please note that this has never been (build-)tested, but should hopefully
resolve the warning.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2015-08-24 10:55:44 +02:00
Andreas Henriksson ec3d3e67d9 hwclock: fix fgets unchecked return value warning on alpha
Build warning:
sys-utils/hwclock-cmos.c: In function 'is_in_cpuinfo':
sys-utils/hwclock-cmos.c:162:4: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
    fgets(field, 256, cpuinfo);

Full build log:
https://buildd.debian.org/status/fetch.php?pkg=util-linux&arch=alpha&ver=2.26.2-9&stamp=1440078034

Detected by/via:
https://qa.debian.org/bls/packages/u/util-linux.html

This change has never actually been (build-)tested on alpha, but
hopefully the change should fix the warning.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2015-08-24 10:55:41 +02:00
Andreas Henriksson 88294abaf9 hwclock: fix signed/unsigned comparison warning on alpha
Fixes the following warning:
sys-utils/hwclock.c: In function 'manipulate_epoch':
sys-utils/hwclock.c:1465:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (epoch_opt == -1)

Full build log available on:
https://buildd.debian.org/status/fetch.php?pkg=util-linux&arch=alpha&ver=2.26.2-9&stamp=1440078034

Detected by/via:
https://qa.debian.org/bls/packages/u/util-linux.html

Please note that this has never actually been (build-)tested on alpha,
but should hopefully resolve the warning. Note also that limits.h is
already included.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2015-08-24 10:55:39 +02:00
Sami Kerola 624e147ba2 misc: fix shadow declarations
sys-utils/zramctl.c: In function 'get_mm_stat':
sys-utils/zramctl.c:276:58: warning: declaration of 'inbytes' shadows a global declaration [-Wshadow]
 static char *get_mm_stat(struct zram *z, size_t idx, int inbytes)
sys-utils/zramctl.c:119:39: note: shadowed declaration is here
 static unsigned int raw, no_headings, inbytes;

libmount/src/tab.c: In function 'mnt_table_get_fs_root':
libmount/src/tab.c:1221:22: warning: declaration of 'fs' shadows a parameter [-Wshadow]
    struct libmnt_fs *fs = mnt_table_find_mountpoint(tb,
libmount/src/tab.c:1197:24: note: shadowed declaration is here
      struct libmnt_fs *fs,

disk-utils/fsck.minix.c: In function 'main':
disk-utils/fsck.minix.c:1364:17: warning: declaration of 'i' shadows a previous local [-Wshadow]
   unsigned long i, free;
disk-utils/fsck.minix.c:1250:6: note: shadowed declaration is here
  int i;

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-24 10:55:37 +02:00
Karel Zak 9ac77b8a78 libmount: add support for "bind,ro"
Now it's necessary t use two mount(8) calls to create a read-only
mount:

  mount /foo /bar -o bind
  mount /bar -o remount,ro,bind

This patch allows to specify "bind,ro" and the remount is done
automatically by libmount by additional mount(2) syscall. It's not
atomic of course.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-17 11:54:26 +02:00
Karel Zak 2279ab60ba Merge branch 'colcrt' of git://github.com/kerolasa/lelux-utiliteetit
* 'colcrt' of git://github.com/kerolasa/lelux-utiliteetit:
  tests: add colcrt regression tests
  colcrt: allocate enough space for data moves [afl & asan]
  colcrt: avoid writing beyond array bound [afl & asan]
  colcrt: use #define in place of magic constants
  misc: fix redundant assignment and reassignments before use [cppcheck]
  tools: stop checkmans.sh validating libtool builds
2015-08-12 22:53:47 +02:00
Karel Zak 2aedcdf4bf Merge branch 'patch-1' of https://github.com/borutmrak/util-linux
* 'patch-1' of https://github.com/borutmrak/util-linux:
  mount.8: also note diratime does not override noatime.
  mount.8: Clarify relation between noatime and nodiratime
2015-08-12 11:09:04 +02:00
Karel Zak a4839bc781 lsipc: add more resource to the limits list
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-12 10:21:48 +02:00
Borut Mrak e7d53b984a mount.8: also note diratime does not override noatime. 2015-08-11 03:00:29 +02:00
Borut Mrak 6e73b6113b mount.8: Clarify relation between noatime and nodiratime
According to https://lwn.net/Articles/245002/ and checking Linus' git master fs/inode.c it's obvious nodiratime is redundant when mounting with noatime. Clarify that in the man page.
2015-08-11 02:51:36 +02:00
Sami Kerola ee24ab6f1e misc: fix redundant assignment and reassignments before use [cppcheck]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-08 07:46:39 +01:00
Karel Zak 7ff635bff4 misc: fix indention [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 13:22:05 +02:00
Karel Zak 6b497c0e19 rtcwake: improve open() usage [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 11:33:29 +02:00
Karel Zak 71b63dc14f lsipc: cleanup usernames
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 14:22:31 +02:00
Karel Zak fadf556a70 lsipc: check scols_line_refer_data() return code
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 14:05:33 +02:00
Karel Zak cdb4a9464d lsipc: don't duplicate already allocated data
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 13:57:45 +02:00
Karel Zak 21ce5a5d70 lsipc: ifdef SHM_* macros
Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-03 13:20:56 +02:00
Benno Schulenberg d000470d51 unshare: remove angular brackets from literal argument in usage text
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-08-03 11:19:10 +02:00
Benno Schulenberg 89de71b347 mount: remove duplications of --help and --version from usage text
And slice up the affected portions.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-08-03 11:19:02 +02:00
Benno Schulenberg 62eea9ce12 textual: adjust grammar and punctuation of some messages
Also equalize three messages to one other one,
and fix a typo in USE_COLORS_BY_DEFAULT.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-08-03 11:18:56 +02:00
Karel Zak d8461c4e4d lsipc: cleanup {user,group}name usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-30 09:18:33 +02:00
Karel Zak a172badb03 hwclock: make static analyzes more happy
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 14:20:06 +02:00
Karel Zak 9380fbefa6 lsipc: value is never read [clang analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 13:54:54 +02:00
Karel Zak ca155f53c3 unshare: remove duplicate [make checkincludes]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 12:58:06 +02:00
Karel Zak 2916afa3f5 lsipc: make --id usable with all output formats and with -o
This patch allows to use things like:

 # lsipc -m --id 47611910 -o COMMAND,SIZE,KEY --json

or

 # lsipc -m --id 47611910 -o SIZE --bytes --noheadings --raw

to get just one value for the resource.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-23 11:09:49 +02:00