summaryrefslogtreecommitdiffstats
path: root/disk-utils/fsck.cramfs.c
Commit message (Collapse)AuthorAgeFilesLines
* textual: grammarize and harmonize the stat error messageBenno Schulenberg2015-02-021-1/+1
| | | | | | | | | The message "stat failed %s" seems to say that stat() failed to do something, or failed to pass a test, but of course it means that the statting of something failed. So say so. Also make two very similar messages equal to this one. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* maint: fix shadow declarationSami Kerola2015-01-071-23/+24
| | | | | | | | | | | | | | | | This change fixes all shadow declarations. The worth while to mention fix is with libfdisk sun geometry. It comes from bitops.h cpu_to_be16 macro that further expands from include/bits/byteswap.h that has the shadowing. libfdisk/src/sun.c:961:173: warning: declaration of '__v' shadows a previous local [-Wshadow] libfdisk/src/sun.c:961:69: warning: shadowed declaration is here [-Wshadow] libfdisk/src/sun.c:961:178: warning: declaration of '__x' shadows a previous local [-Wshadow] libfdisk/src/sun.c:961:74: warning: shadowed declaration is here [-Wshadow] That could have caused earlier some unexpected results. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* textual: add a docstring to most of the utilitiesBenno Schulenberg2015-01-061-0/+4
| | | | | | | | | 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>
* textual: fix some typos and inconsistencies in various messagesBenno Schulenberg2014-07-231-1/+1
| | | | | | | | Fixing plain typos, miswordings, inconsistent periods, some missing angular brackets, and a proper pluralization (even when it involves a constant, because for some languages the precise value matters). Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* build: fix some compiler warningsRuediger Meier2014-05-301-2/+2
| | | | | | | | | | | | Most of them catched on 32bit gcc and icc. disk-utils/fsck.cramfs.c: printf format type lib/boottime.c: unused variables misc-utils/cal.c: set but never used sys-utils/losetup.c: set but never used sys-utils/lscpu-dmi.c: defined but not used sys-utils/switch_root.c: comparison between signed and unsigned tests/helpers/test_sysinfo.c: printf format type
* fsck.cramfs: cleanup usage() and warning messagesKarel Zak2014-05-201-7/+5Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: remove define INCLUDE_FS_TESTSRuediger Meier2014-05-191-24/+5Star
| | | | | | | There is only one non-trivial issue where we now print a warning instead of exit error. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fsck.cramfs: refactor option -x/--extractRuediger Meier2014-05-191-14/+17
| | | | | | | | | | | | | | | | | We want to clean it up to compile it later per default (not only if defined INCLUDE_FS_TESTS). - Rename option --destination to --extract. - DIR argument is now optional because we want to keep the use case "test uncompression without writing files" ... but we don't want it always. - Remove shortopt -x because shortopts with optional args are evil. Changing the cmd interface is no compatibility issue here because all affected options errored out per default in past. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fsck.cramfs: add option --blocksizeRuediger Meier2014-05-191-3/+12
| | | | | | .. similar to mkfs.cramfs Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fsck.cramfs: rename variable page_size to blksizeRuediger Meier2014-05-191-11/+11
| | | | | | ... similar to mkfs.cramfs.c Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fsck.cramfs: ifdef unused outbuffer and page_sizeRuediger Meier2014-05-191-5/+4Star
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fsck.cramfs: allow smaller superblock sizesRuediger Meier2014-05-191-1/+2
| | | | | | | | | | We are already fine with checking for different endianess. Now we also succeed if systems's page size does not match. Note that page_size is only really used if INCLUDE_FS_TESTS is defined, see followups. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fsck.cramfs: add LC_CTYPEKarel Zak2013-10-181-0/+1
| | | | | | | Maybe it would be possible to use LC_ALL, but it requires to review the code to check if there is no any sensitive code. Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: standardize some "cannot read" and "seek failed" error messagesBenno Schulenberg2013-10-091-7/+7
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* fsck.cramfs: check writing to a file descriptor was successfulSami Kerola2013-04-261-1/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* fsck.cramfs: check returns [coverity scan]Karel Zak2013-03-271-4/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: fix compiler warningsKarel Zak2013-03-151-4/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: add dummy -a -y for compatibilityKarel Zak2013-02-181-2/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: fix compiler warning [-Wpointer-arith]Karel Zak2012-09-041-2/+2
| | | | | | | | disk-utils/fsck.cramfs.c: In function ‘test_crc’: disk-utils/fsck.cramfs.c:231:32: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith] disk-utils/fsck.cramfs.c:233:24: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith] Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: fix compiler warning [-Wmissing-prototypes]Karel Zak2012-07-161-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* translation: unify file open error messagesSami Kerola2012-07-161-2/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* translation: unify stat error messagesSami Kerola2012-07-161-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* fsck.cramfs: disallow unknown command line optionsSami Kerola2012-06-171-0/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* disk-utils: verify writing to streams was successfulSami Kerola2012-04-041-0/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* fsck.cramfs: add long optionsSami Kerola2012-03-301-12/+20
| | | | | | And align with howto-usage-function.txt Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include/exitcodes: clean up names, add _EX_ suffixKarel Zak2012-03-201-52/+52
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* xalloc: use xasprintf in all filesSami Kerola2012-03-181-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: corrections to FSF license files, and postal addressSami Kerola2012-02-241-3/+3
| | | | | | | | | | | | | | The COPYING and Documentation/licenses/COPYING* files are being replaced by files from GNU web site. http://www.gnu.org/licenses/gpl-2.0.txt http://www.gnu.org/licenses/lgpl-2.1.txt Postal addresses to FSF in other files are updated to match with the address in license files. Reference: http://lists.gnu.org/archive/html/freefont-announce/2005-04/msg00001.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* fsck.cramfs: mark usage() as noreturnKarel Zak2012-01-311-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: move fsck return values to exitcodes.hSami Kerola2011-07-221-9/+1Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* fsck.cramfs: add missed strings to translationSami Kerola2011-07-211-4/+4
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* fsck.cramfs: coding styleSami Kerola2011-07-211-219/+180Star
| | | | | | | Lots of braces got to be removed, which can cause something to break even everything is double checked. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* fsck.cramfs: use xalloc.hSami Kerola2011-07-211-24/+16Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* fsck.cramfs: retire die functionSami Kerola2011-07-211-69/+53Star
| | | | | | Replaced with err{,x} from libc. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* cramfs: use stdint.h instead of u{8,16,32}Sami Kerola2011-07-201-4/+5
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* cramfs: remove cramfs_common.hDavidlohr Bueso2011-05-171-1/+0Star
| | | | | | | We currently have cramfs.h and cramfs_common.h, this makes no sense, so remove unite them and keep just cramfs.h Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* Remove now unused <sys/ioctl.h> includesGuillem Jover2009-10-091-1/+0Star
| | | | | | Those became unused with the switch to the blkdev functions. Signed-off-by: Guillem Jover <guillem@hadrons.org>
* fsck.cramfs: segfault with INCLUDE_FS_TESTS and no -x optionKarel Zak2009-02-041-2/+3
| | | | | | | | | | The current implementation causes a segmentation fault if INCLUDE_FS_TESTS is defined, but the -x option is not specified. The error is caused by the extract_dir variable being null. Reported-by: Roy Peled <the.roy.peled@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: add endianness support to cramfs toolsSigned-off-by: Roy Peled2009-02-041-12/+37
| | | | | | | | | | | | | | | | | | | | cramfs is an endianness dependent file system. So far, the cramfs utilities did not support cramfs images of different endianness than the host machine. A separate utility, cramfsswap, was required in order to change the endianness of the image before and after using cramfs utilities. The extra utility introduced extra maintenance and an additional step in the process. This patch adds endianness support to mkfs.cramfs and fsck.cramfs. fsck.cramfs now automatically detects the image endianness, and can work on images of either endianness. mkfs.cramfs now accepts a new optional parameter (-N) that allows creating the cramfs image in either endianness. Signed-off-by: Roy Peled <the.roy.peled@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: add NLS supportPedro Ribeiro2008-10-031-56/+60
| | | | | | | [kzak@redhat.com: - add setlocale(), ...] Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: fix compiler warningKarel Zak2008-09-291-1/+1
| | | | | | | fsck.cramfs.c: In function ‘main’: fsck.cramfs.c:676 warning: ‘length’ may be used uninitialized in this function Signed-off-by: Karel Zak <kzak@redhat.com>
* use getpagesize()maximilian attems2008-07-301-1/+1
| | | | | | | | | | | | getpagesize() is said to be more portable than sysconf(_SC_PAGESIZE) to anything Linux. this patch helps klibc porting effort as the sysconf multiplex API is not supported there. also remove comment of the switch to sysconf in mkswap.c. Signed-off-by: maximilian attems <max@stro.at>
* disk-utils: clean up code, use blkdev_* functionsSamuel Thibault2008-07-241-4/+4
| | | | | | | [kzak@redhat.com: split the original patch to small patches] Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: clean up gcc warningsRandy Dunlap2007-10-031-1/+2
| | | | | | | | | | | * clean up code, gcc warnings (try compilation with "-Wall -Wp,-D_FORTIFY_SOURCE=2") Builds cleanly on x86_32 and x86_64. fsck.cramfs.c:235: warning: ignoring return value of 'read', declared with attribute warn_unused_result Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
* build-sys: remove hardcoded _GNU_SOURCEKarel Zak2007-09-201-1/+0Star
| | | | | | We have AC_GNU_SOURCE, so we needn't any extra hardcoded _GNU_SOURCE. Signed-off-by: Karel Zak <kzak@redhat.com>
* Imported from util-linux-2.13-pre5 tarball.Karel Zak2006-12-071-345/+434
|
* Imported from util-linux-2.13-pre1 tarball.Karel Zak2006-12-071-6/+3Star
|
* Imported from util-linux-2.12k tarball.Karel Zak2006-12-071-0/+10
|
* Imported from util-linux-2.11t tarball.Karel Zak2006-12-071-0/+625