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>
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>
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>
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>
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>