summaryrefslogtreecommitdiffstats
path: root/disk-utils/mkfs.cramfs.c
Commit message (Collapse)AuthorAgeFilesLines
* misc: consolidate version printing and close_stdout()Karel Zak2019-04-161-4/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: properly copy disk nameKarel Zak2018-10-031-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: remove redundant conditionKarel Zak2018-07-181-1/+1
| | | | | | | util-linux-2.32.1/disk-utils/mkfs.cramfs.c:362]: (style) Redundant condition: If 'EXPR >= 16777216', the comparison 'EXPR' is always true. Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: fix typos using codespellRuediger Meier2018-02-161-1/+1
| | | | | | Some more funny typos, please review carefully. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* lib/md5: use ul_/UL_ prefixKarel Zak2017-12-121-6/+7
| | | | | | | The symbols names are too generic. Addresses: https://github.com/karelzak/util-linux/issues/548 Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate macro style USAGE_HELP_OPTIONSRuediger Meier2017-06-291-1/+1
| | | | | | | | | 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>
* docs: remove some old history from manpagesRuediger Meier2017-06-291-3/+2Star
| | | | | | | | We assume that users will have a kernel >= 2.6.0 and removel references to earlier kernels. There are still a few ones left. 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>
* Merge branch 'fix-exit-codes' of https://github.com/rudimeier/util-linuxKarel Zak2017-06-261-1/+2
|\ | | | | | | | | | | | | | | | | * 'fix-exit-codes' of https://github.com/rudimeier/util-linux: misc: fix optutils.h related exit codes misc: fix xalloc.h related exit codes misc: fix more strutils related exit codes lib: fix strutils.h, remove STRTOXX_EXIT_CODE misc: fix some broken exit codes
| * misc: fix more strutils related exit codesRuediger Meier2017-06-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Found by grep: grep -l "\bEXIT_\|exit *( *[0-9][0-9] *)\|strutils\.h" $(grep -L \ strutils_set_exitcode $(git grep -l "_EX_\|FINDFS_\|BLKID_EXIT\|EX_USAGE" -- "*.c")) The Command shows also some false positives (fstrim.c, context_mount.c, ...) Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * misc: fix some broken exit codesRuediger Meier2017-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tools have special exit codes. They got changed mistakenly. See: findfs 0e1fa6b6 fsck 658c0891 fsck.cramfs 922ec175 mkfs.cramfs 16154b1f tunelp 2ab428f6 FIXME: STRTOXX_EXIT_CODE doesn't work as it should. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | mkfs.cramfs: add --help and --versionRuediger Meier2017-06-251-11/+23
|/ | | | | | | Note, we were already using errtryhelp() without providing a --help option. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: fix ggc-7 fallthrough warningsSami Kerola2017-06-141-1/+1
| | | | | | | | | | | | | | | | | | | (Original patch and commit message edited by Rudi.) gcc-7 adds -Wimplicit-fallthrough=3 to our default flag -Wextra. This warning can be silenced by using comment /* fallthrough */ which is also recognized by other tools like coverity. There are also other valid comments (see man gcc-7) but we consolidate this style now. We could have also used __attribute__((fallthrough)) but the comment looks nice and does not need to be ifdef'ed for compatibility. Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652 Reference: https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/ Reviewed-by: Ruediger Meier <ruediger.meier@ga-group.nl> Suggested-by: Karel Zak <kzak@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: do not use plain 0 as NULL [smatch scan]Sami Kerola2017-02-201-3/+3
| | | | | | | | | | 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-1/+1
| | | | | | | | 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>
* cramfs: revert crc32 changesKarel Zak2016-10-191-4/+9
| | | | | | | | We cannot use our crc32 without changes in the code, because our ul_crc32() assumes that post-conditioning (xor) is done by application. The zlib implementation does everything. Signed-off-by: Karel Zak <kzak@redhat.com>
* cramfs: add missing includesKarel Zak2016-10-191-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/crc32: prefix public functionsGustavo Zacarias2016-10-191-3/+3
| | | | | | | | | | | Make the publicly-visible crc32 library functions prefixed by ul_, such as crc32() -> ul_crc32(). This is because it clashes with the crc32() function from zlib. For newer versions of glib (2.50+) zlib and libblkid are required dependencies and otherwise results in build failure when building statically. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
* include/closestream: define exit codesKarel Zak2016-08-161-1/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: simplify if clauses [oclint]Sami Kerola2016-07-211-9/+6Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* 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>
* mkfs.cramfs: remove dead code [coverity scan]Karel Zak2015-08-041-16/+7Star
| | | | | | | | | There two possible ways, print error and exit on too long names or truncate the filename -- but it's impossible to do both in the same code :-) It seems that code already assumes warning on long names, so let's remove errx() and keep the behavior in dependence on -E. Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: grammarize and harmonize the stat error messageBenno Schulenberg2015-02-021-3/+3
| | | | | | | | | 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>
* textual: improve error messagesSami Kerola2014-12-091-1/+1
| | | | | | | Use error printing facilities that add command name in front of the error message, and add explanation that is part of existing translations. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mkfs.cramfs: use defined failure name rather than magic valueSami Kerola2014-07-131-4/+2Star
| | | | | | | | From manual page; 'On error, the value MAP_FAILED is returned, and errno is set appropriately'. Reference: http://man7.org/linux/man-pages/man2/mmap.2.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mkfs.cramfs: fix crash when -b 0Ruediger Meier2014-05-191-2/+4
| | | | | | | Now -b 0 gives us the default (page size) like we do it in fsck.cramfs. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* mkfs.cramfs: argument to free() is a constant address [clang-analyzer]Sami Kerola2013-07-091-1/+0Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* textual: improve clarity of some error messagesBenno Schulenberg2013-06-071-3/+3
| | | | | Reported-by: Petr Písař <petr.pisar@atlas.cz> Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* mkfs.cramfs: use standard error messageKarel Zak2013-05-141-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: unify write check to a file descriptorSami Kerola2013-04-261-3/+2Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mkfs.cramfs: fix resource leak [coverity scan]Karel Zak2013-03-271-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: fix memory leak [coverity scan]Karel Zak2013-03-271-7/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: use UTIL_LINUX_VERSION everywhereKarel Zak2013-01-251-2/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* translation: unify file open error messagesSami Kerola2012-07-161-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* translation: unify stat error messagesSami Kerola2012-07-161-2/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mkfs.cramfs: disallow unknown command line optionsSami Kerola2012-06-171-0/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mkfs.cramfs: remove unused 'MIN' macro definitionPetr Uzel2012-05-231-4/+0Star
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* disk-utils: cleanup strtoxx_or_err()Karel Zak2012-05-151-10/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* disk-utils: verify writing to streams was successfulSami Kerola2012-04-041-0/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include/exitcodes: clean up names, add _EX_ suffixKarel Zak2012-03-201-21/+21
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* 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>
* mkfs.cramfs: check blocksize user input [cppcheck]Sami Kerola2012-02-081-3/+8
| | | | | | | | | | | | Enhance user input checking and error messaging, while fixing cppcheck warning. [disk-utils/mkfs.cramfs.c:729]: (style) Checking if unsigned variable 'blksize' is less than zero. [kzak@redhat.com: fix coding style] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: close open file after usage [cppcheck]Sami Kerola2012-02-081-0/+1
| | | | | | [disk-utils/mkfs.cramfs.c:913]: (error) Resource leak: fd Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* small bug in mkfs.cramfs + patchArnaud Mouiche2011-11-231-3/+3
| | | | | | | | | | | | | | | | | | | mkfs.cramfs on version v2.17.2 has a small bug when dealing with very small filesystems. look at upstream code on git, and the issue is still here. ex: $ cd /tmp $ mkdir content $ echo hello > content/a $ echo hello > content/b $ mkfs.cramfs content content.cramfs not enough space allocated for ROM image (4090 allocated, 4096 used) Here is a patch for fixing (simply rounding to page size AFTER eleminating doubles). Signed-off-by: Arnaud Mouiche <arnaud.mouiche@invoxia.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: clearer error message, "cannot close" instead of "closing"Benno Schulenberg2011-08-151-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* include: move disk-utils/mkfs.h -> include/exitcodes.hSami Kerola2011-07-221-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mkfs.cramfs: coding styleSami Kerola2011-07-221-27/+27
| | | | | | Clean up to two if clauses and fix to a version print out format. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mkfs.cramfs: include-what-you-use header checkSami Kerola2011-07-221-1/+2
| | | | | | | | add these lines: #include <stddef.h> // for size_t #include <zconf.h> // for Bytef, uLongf Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mkfs.cramfs: error printing fixesSami Kerola2011-07-221-71/+45Star
| | | | | | | | | | | | | | | The patch will fix few starange looking errors such as: $ mkfs.cramfs -N foo invalid endianness given. Must be 'big', 'little', or 'host': Success to be more sensible: mkfs.cramfs: invalid endianness given. Must be 'big', 'little', or 'host' And there are couple new return value checks to stop command if out file cannot be opened, or an IO error occurs. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mkfs.cramfs: convert spaces to tabsSami Kerola2011-07-221-44/+44
| | | | | | The conversion is applied only to the line beginnings. Signed-off-by: Sami Kerola <kerolasa@iki.fi>