summaryrefslogtreecommitdiffstats
path: root/sys-utils/swapoff.c
Commit message (Collapse)AuthorAgeFilesLines
* misc: consolidate version printing and close_stdout()Karel Zak2019-04-161-7/+6Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: don't check for swapon() number of argumentsKarel Zak2017-12-181-2/+1Star
| | | | | | | | The syscall swapon() with two arguments is supported since Linux 1.3.2 and it's really long time ago... Let's assume that all libc header files have been already fixed. Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate macro style USAGE_HELP_OPTIONSRuediger Meier2017-06-291-2/+2
| | | | | | | | | changed in include/c.h and applied via sed: sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c") sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c") Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: introduce print_usage_help_options()Ruediger Meier2017-06-271-2/+1Star
| | | | | | | | | | | | Consolidate --help and --version descriptions. We are now able to align them to the other options. We changed include/c.h. The rest of this patch was generated by sed, plus manually setting the right alignment numbers. We do not change anything but white spaces in the --help output. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: never use usage(stderr)Ruediger Meier2017-06-261-5/+8
| | | | | | | Here we fix all cases where we have usage(FILE*) functions. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: do not use plain 0 as NULL [smatch scan]Sami Kerola2017-02-201-5/+5
| | | | | | | | | | text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer Since many 'struct option' has used zero as NULL make them more readable in same go by reindenting, and using named argument requirements. Reference: https://lwn.net/Articles/93577/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Use --help suggestion on invalid optionKarel Zak2016-12-191-2/+1Star
| | | | | | | | The current default is to print all usage() output. This is overkill in many case. Addresses: https://github.com/karelzak/util-linux/issues/338 Signed-off-by: Karel Zak <kzak@redhat.com>
* swapoff: fix mem leak [coverity scan]Karel Zak2016-10-051-1/+4
|
* misc: Fix various typosSebastian Rasmussen2016-05-311-1/+1
| | | | | | | Fix various typos in error messages, warnings, debug strings, comments and names of static functions. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* textual: add a docstring to most of the utilitiesBenno Schulenberg2015-01-061-1/+3
| | | | | | | | | This adds a concise description of a tool to its usage text. A first form of this patch was proposed by Steven Honeyman (see http://www.spinics.net/lists/util-linux-ng/msg09994.html). Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* swapoff: swapoff swap files by LABEL and UUIDKarel Zak2014-11-071-11/+63
| | | | | | | | | | | | | # swapon --show=NAME,UUID NAME UUID /dev/sda3 8d52fca3-bf48-41d6-b826-2315e518a305 /home/fs-images/2g.img 6fa72b96-b802-441f-a31c-091d65c0212c # swapoff UUID=6fa72b96-b802-441f-a31c-091d65c0212c swapoff: cannot find the device for UUID=6fa72b96-b802-441f-a31c-091d65c0212c Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: use libmnt_cache reference countingKarel Zak2013-08-211-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapoff: cleanup usage() and includesKarel Zak2012-04-181-24/+17Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapoff: use libmount to parse fstabKarel Zak2012-04-181-52/+40Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapoff: move code from swapon.c to swapoff.cKarel Zak2012-04-181-0/+215
* multipurpose binaries (symlinks) suck when used with autotools * swapoff shares small subset of the code with swapon * usage() and 'struct option' is unnecessary complex when shared * shorter and simple code is easer to maintain... Signed-off-by: Karel Zak <kzak@redhat.com>