]> err.no Git - util-linux/commit
raw: Use the RAW_SETBIND ioctl without stat'ing the raw# file
authorJeff Mahoney <jeffm@suse.com>
Mon, 29 Jun 2009 21:05:36 +0000 (23:05 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 29 Jun 2009 21:07:09 +0000 (23:07 +0200)
commitb41f637c6490862adf173a3b5796486326cdab1f
tree2f598fbe0a237998dbe6224d132bc8ecd72d936b
parentd5f36dec9209982576b52cbadb74c3abf4b73376
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>
disk-utils/raw.c