summaryrefslogtreecommitdiffstats
path: root/misc-utils/hardlink.c
Commit message (Collapse)AuthorAgeFilesLines
* hardlink: avoid uninitialized variables [clang scan]Karel Zak2019-05-231-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hardlink: fix compiler warnings [-Wsign-compare -Wmaybe-uninitialized]]Karel Zak2019-05-021-3/+3
| | | | | | | | | | misc-utils/hardlink.c: In function ‘process_path’: misc-utils/hardlink.c:287:30: warning: operand of ?: changes signedness from ‘off_t’ {aka ‘long int’} to ‘long unsigned int’ due to unsignedness of other operand [-Wsign-compare] misc-utils/hardlink.c: In function ‘main’: misc-utils/hardlink.c:455:5: warning: ‘exclude_pattern’ may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Karel Zak <kzak@redhat.com>
* hardlink: retire NIOBUF in favour of more common BUFSIZSami Kerola2019-05-011-5/+5
| | | | | | | | | | Reason to retire NIOBUF is that it is obscure local definition, while BUFSIZ is well understood and commonly used constant. Besized sizes of these are not far off, the NIOBUF was 4096 bytes and BUFSIZ tends to be 8192 bytes. Proposed-by: Karel Zak <kzak@redhat.com> Reference: https://github.com/karelzak/util-linux/pull/783 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hardlink: move global variables to a control structureSami Kerola2019-05-011-68/+78
| | | | | | | | | | Well, sort of. Due to use of ctl values in atexit() print_summary() there is need for global control structure. Secondly couple variables can be moved to more restricted scope, namely the PCRE variables are now in main(). Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hardlink: use flexible array member rather than zero-size arraySami Kerola2019-05-011-2/+2
| | | | | | | | | This fixes two standards compliancy warnings. hardlink.c:65:7: warning: ISO C forbids zero-size array ‘name’ [-Wpedantic] Reference: https://en.wikipedia.org/wiki/Flexible_array_member Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hardlink: remove \r from outputKarel Zak2019-04-241-13/+3Star
| | | | | | | | | | | * remove \r from internationalized messages * remove \r from all output to make it easy to use (see for example output file from "hardlink -vv --dry-run . &> log") * remove unnecessary formatting stuff from output, just keep is simple and stupid... Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate version printing and close_stdout()Karel Zak2019-04-161-3/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hardlink, wall: fix variable shadowingSami Kerola2019-02-181-2/+2
| | | | | | | | | | | | | misc-utils/hardlink.c:91:65: warning: declaration shadows a variable in the global scope [-Wshadow] misc-utils/hardlink.c:73:5: note: previous declaration is here int content_only = 0; term-utils/wall.c:114:40: warning: declaration shadows a variable in the global scope [-Wshadow] term-utils/wall.c:129:65: warning: declaration shadows a variable in the global scope [-Wshadow] /usr/include/bits/getopt_core.h:36:14: note: previous declaration is here extern char *optarg; Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hardlink: add long optionsKarel Zak2019-02-111-8/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hardlink: rename functionKarel Zak2019-02-111-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hardlink: make code more readableKarel Zak2019-02-111-9/+31
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hardlink: cleanup global variablesKarel Zak2019-02-111-20/+23
| | | | | | | | * remove NAMELEN, use PATH_MAX * mark global variables as static * move all global variables to the begin of the code Signed-off-by: Karel Zak <kzak@redhat.com>
* hardlink: remove typedefsKarel Zak2019-02-111-32/+33
| | | | | | | - remove typedefs - use long names for structs Signed-off-by: Karel Zak <kzak@redhat.com>
* hardlink: cleanup error messages, use xalloc.hKarel Zak2019-02-061-48/+30Star
| | | | | | | - do not use magical doexit(), just use err() - print summary on exit Signed-off-by: Karel Zak <kzak@redhat.com>
* hardlink: cleanup verbose and warning messagesKarel Zak2019-02-061-61/+43Star
| | | | | | | - use warn() - use stdout rather than stderr Signed-off-by: Karel Zak <kzak@redhat.com>
* hardlink: util-linux usageRuediger Meier2018-11-141-20/+51
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* hardlink: fix compiler warningsRuediger Meier2018-11-141-12/+11Star
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* hardlink: style indentations and license headerRuediger Meier2018-11-121-356/+413
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* hardlink: enable build with and without pcre2Ruediger Meier2018-11-121-2/+17
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* Fixed version number, added changelog about Todd Lewis' patchFrancisco Javier Tsao Santín2018-06-121-0/+1
|
* exclude files via pcreTodd Lewis2018-06-121-9/+44
|
* Fixed 32 bit build with gcc7 (RH Bugzilla ID 1422989)Francisco Javier Tsao Santín2018-06-121-4/+4
|
* spec file reflects the atomic hardlinking patch; removed cleaning buildroot ↵Francisco Javier Tsao Santín2018-06-121-4/+4
| | | | (redundant); update FSF address at .c source file
* Revert "spec file reflects the atomic hardlinking patch; removed cleaning ↵Francisco Javier Tsao Santín2018-06-121-12/+15
| | | | | | buildroot (redundant); current FSF address at .c source file" This reverts commit bb9e76ae339794c2243ae294207942b7ea278364.
* spec file reflects the atomic hardlinking patch; removed cleaning buildroot ↵Francisco Javier Tsao Santín2018-06-121-4/+3Star
| | | | (redundant); current FSF address at .c source file
* do not allow to hardlink files across filesystems by default (#786719)Jindrich Novy2018-06-121-4/+16
| | | | (use -f option to override)
* fix possible buffer overflows, integer overflows, update man pageJindrich Novy2018-06-121-40/+85
|
* fix URL and remove mmap() (#676962, #672917)Jindrich Novy2018-06-121-33/+19Star
|
* - update docs to describe highest verbosity -vv option (#210816)Jindrich Novy2018-06-121-1/+2
| | | | - use dist Resolves: 210816
* mostly spec cleanupJindrich Novy2018-06-121-1/+2
|
* add -h optionJindrich Novy2018-06-121-3/+5
|
* Document hardlink command line options. (Ville Skytta) (#161738)Dave Jones2018-06-121-0/+3
|
* - don't try to hardlink 0 byte files (#154404)Jeremy Katz2018-06-121-2/+2
|
* kill warningDave Jones2018-06-121-1/+1
|
* auto-import hardlink-1.0-1.1 on branch devel from hardlink-1.0-1.1.src.rpmDave Jones2018-06-121-0/+344