Commit Graph

20 Commits

Author SHA1 Message Date
Sami Kerola d5fc1b1581 raw: check numeric user inputs
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola 16d8a9c967 raw: use pathnames.h for file locations
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola 82b7ef3671 raw: use libc error printing facilities
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola 44e535353e raw: use symbolic exit numbers
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola 1e0aef8257 raw: add long options and version printing
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola 7c7c8bc53b raw: align with howto-usage-function.txt
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola 82cdf1b194 raw: remove unnecessary return [cppcheck]
[disk-utils/raw.c:171]: (style) Consecutive return, break, continue, goto or throw statements are unnecessary.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-08 12:52:46 +01:00
Petr Uzel 960cf5737e misc: use %m in format string instead of %s and strerror(errno)
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2011-09-27 15:46:07 +02:00
maximilian attems 89c5005380 raw: fix shadowing of minor function
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>
2011-08-30 11:52:03 +02:00
Benno Schulenberg 70532ede1a raw: remove constants from message strings; undo some abbrevs
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>
2011-03-08 13:14:50 +01:00
Jeff Mahoney b41f637c64 raw: Use the RAW_SETBIND ioctl without stat'ing the raw# file
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>
2009-06-29 23:07:09 +02:00
Karel Zak 6db4681802 raw: default to /dev/raw/rawctl
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>
2008-12-26 01:13:03 +01:00
Pedro Ribeiro 5dd48fb28f raw: add NLS support
[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>
2008-10-03 08:46:36 +02:00
maximilian attems d5c28ebc32 disk-utils: include fcntl.h directly (mkfs.cramfs, raw)
helps klibc support, glibc compile tested.

Signed-off-by: maximilian attems <max@stro.at>
2008-07-28 11:09:14 +02:00
Karel Zak 34ab1590bd raw: don't accept raw0 as a target name
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>
2007-01-26 19:55:41 +01:00
Karel Zak ffc4374869 Imported from util-linux-2.11o tarball. 2006-12-07 00:25:53 +01:00
Karel Zak 364cda4857 Imported from util-linux-2.11f tarball. 2006-12-07 00:25:48 +01:00
Karel Zak 66ee8158b6 Imported from util-linux-2.10s tarball. 2006-12-07 00:25:44 +01:00
Karel Zak 22853e4a82 Imported from util-linux-2.10m tarball. 2006-12-07 00:25:43 +01:00
Karel Zak eb63b9b8f4 Imported from util-linux-2.10f tarball. 2006-12-07 00:25:41 +01:00