summaryrefslogtreecommitdiffstats
path: root/disk-utils/raw.c
Commit message (Collapse)AuthorAgeFilesLines
* misc: consolidate version printing and close_stdout()Karel Zak2019-04-161-3/+2Star
| | | | 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(ERROR)Ruediger Meier2017-06-261-13/+18
| | | | | | | | | | We are using better/shorter error messages and somtimes also errtryhelp(). Here we fix all cases where the usage function took an int argument for exit_code. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: add static keyword to where needed [smatch scan]Sami Kerola2017-02-201-4/+4
| | | | | | | text-utils/rev.c:68:9: warning: symbol 'buf' was not declared. Should it be static? Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* 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-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>
* include: move sys/sysmacros.h to c.hKarel Zak2016-03-081-3/+0Star
| | | | | | | The file is no portable (#ifdef HAVE_SYS_SYSMACROS_H is necessary), but needed on many places. It seems better to keep it in c.h. Signed-off-by: Karel Zak <kzak@redhat.com>
* include: check for sys/sysmacros.hRuediger Meier2016-02-181-0/+2
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* raw: fix raw queryKarel Zak2015-01-131-1/+1
| | | | | | | Bug introduced by commit cd121363. References: https://bugzilla.redhat.com/show_bug.cgi?id=1181444 Signed-off-by: Karel Zak <kzak@redhat.com>
* 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>
* raw: use LC_ALLKarel Zak2013-10-181-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* raw: fix "Error setting raw device: Success"Karel Zak2013-03-211-1/+1
| | | | | | | | # raw /dev/raw/raw1 253 40 raw: Error setting raw device:Success Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=923820 Signed-off-by: Karel Zak <kzak@redhat.com>
* raw: fix compiler warning [-Wmissing-prototypes]Karel Zak2012-07-161-1/+1
| | | | 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>
* raw: clean up coding styleSami Kerola2012-03-301-44/+29Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* raw: check numeric user inputsSami Kerola2012-03-301-2/+29
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* raw: use pathnames.h for file locationsSami Kerola2012-03-301-14/+14
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* raw: use libc error printing facilitiesSami Kerola2012-03-301-61/+37Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* raw: use symbolic exit numbersSami Kerola2012-03-301-16/+18
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* raw: add long options and version printingSami Kerola2012-03-301-7/+18
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* raw: align with howto-usage-function.txtSami Kerola2012-03-301-8/+15
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* raw: remove unnecessary return [cppcheck]Sami Kerola2012-02-081-2/+0Star
| | | | | | [disk-utils/raw.c:171]: (style) Consecutive return, break, continue, goto or throw statements are unnecessary. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: use %m in format string instead of %s and strerror(errno)Petr Uzel2011-09-271-8/+6Star
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* raw: fix shadowing of minor functionmaximilian attems2011-08-301-8/+8
| | | | | | | | | | | | | | | Noticed while compiling against klibc: raw.c: In function ‘query’: raw.c:219:16: error: called object ‘minor’ is not a function Rename variable from minor to minor_raw. While at it mark the functions as static and small whitespace fixes as asked by checkpatch. [kzak@redhat.com: - rename variable at line 241 too] Signed-off-by: maximilian attems <max@stro.at> Signed-off-by: Karel Zak <kzak@redhat.com>
* raw: remove constants from message strings; undo some abbrevsBenno Schulenberg2011-03-081-14/+13Star
| | | | | | | | Having a constant embedded within a message string prevents gettext from picking up the rest of the string. Also, translators may wish to change word order; using a constant as a prefix or postfix makes this impossible. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* raw: Use the RAW_SETBIND ioctl without stat'ing the raw# fileJeff Mahoney2009-06-291-26/+32
| | | | | | | | | | | | | | | | | | The in-kernel ioctl code creates a raw# device on-demand. udev will create the /dev/raw/raw# file when the device is created automatically. The current raw userspace code wants to stat the file before using it, which is unnecessary for setting up the raw device. This patch stats the file only when query() is called as a singleton, and it's doubtful it's needed even there. I modified as little code as I could, though. [kzak@redhat.com: - check properly fscanf() return code - add NLS stuff] Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* raw: default to /dev/raw/rawctlKarel Zak2008-12-261-11/+9Star
| | | | | | | | | | The raw devices are in the raw/ subdirectory. It makes sense to use the same subdirectory also for the control file. The old /dev/rawctl is also supported as a fallback. The #ifdef OLD_RAW_DEVS (/dev/raw<N>) is unsupported from now. Signed-off-by: Karel Zak <kzak@redhat.com>
* raw: add NLS supportPedro Ribeiro2008-10-031-35/+40
| | | | | | | | [kzak@redhat.com: - add setlocale(), ... - remove tailing white spaces] Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* disk-utils: include fcntl.h directly (mkfs.cramfs, raw)maximilian attems2008-07-281-1/+1
| | | | | | helps klibc support, glibc compile tested. Signed-off-by: maximilian attems <max@stro.at>
* raw: don't accept raw0 as a target nameKarel Zak2007-01-261-6/+28
| | | | | | | The raw0 is rawctl and cannot be used as a normal raw device. The patch also enlarge range of <N> for raw<N> and improve the query mode. Signed-off-by: Karel Zak <kzak@redhat.com>
* Imported from util-linux-2.11o tarball.Karel Zak2006-12-071-5/+13
|
* Imported from util-linux-2.11f tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.10s tarball.Karel Zak2006-12-071-0/+1
|
* Imported from util-linux-2.10m tarball.Karel Zak2006-12-071-10/+18
|
* Imported from util-linux-2.10f tarball.Karel Zak2006-12-071-0/+217