summaryrefslogtreecommitdiffstats
path: root/sys-utils/swapon-common.c
Commit message (Collapse)AuthorAgeFilesLines
* mount, umount, swapon, fsck, lsblk, findmnt: harmonize six error messagesBenno Schulenberg2016-03-161-2/+1Star
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* misc: never cast void* from malloc(3) and friendsRuediger Meier2016-03-071-2/+2
| | | | | | | | | | Such cast could hide serious compiler warnings in case we are missing includes (e.g. <stdlib.h> or "xalloc.h"). See http://stackoverflow.com/questions/605845/do-i-cast-the-result-of-malloc Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* mount, umount, swapon, fsck, lsblk, findmnt: ignore malformed linesKarel Zak2015-10-151-0/+11
| | | | | | | | | | | | | | | | | 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>
* swapon: split swapon-common.cKarel Zak2014-09-221-45/+2Star
| | | | | | | | | | | swapon - requires libmount and libblkid swapoff - requires libmount swaplabel - requires libblkid This patch add lib/swapprober.c with blkid stuff for swap. It allows to use and link libblkid only when necessary. Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: share get_swap_prober() with swaplabel to print uuid and labelSami Kerola2014-07-221-0/+44
| | | | | | | | | | | | The swapon(8) listing was almost complete, apart from label and uuid. This change moves the code from swaplabel(8) to shared scope to be used for printouts in other swap commands, such as swapon. Adding this feature to lsblk(8) was a consideration, but lsblk is not interested of swapfiles, so the swapon seems like a better option to add this information. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: use libmnt_table reference counterKarel Zak2013-08-211-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapoff: use libmount to parse fstabKarel Zak2012-04-181-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: move generic code to swapon-common.cKarel Zak2012-04-181-0/+106
This will allow to use separate binary for swapon and swapoff. Signed-off-by: Karel Zak <kzak@redhat.com>