What we're actually passing around is an ioctl request, not a command,
and it's an unsigned long, not an int.
This commit is contained in:
parent
134cd96fec
commit
5159643adc
@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
|
|
||||||
static void rulespec_infp(FILE *fp, int cmd, devfs_rsnum rsnum);
|
static void rulespec_infp(FILE *fp, unsigned long reqest, devfs_rsnum rsnum);
|
||||||
static void rulespec_instr(struct devfs_rule *dr, const char *str,
|
static void rulespec_instr(struct devfs_rule *dr, const char *str,
|
||||||
devfs_rsnum rsnum);
|
devfs_rsnum rsnum);
|
||||||
static void rulespec_intok(struct devfs_rule *dr, int ac, char **av,
|
static void rulespec_intok(struct devfs_rule *dr, int ac, char **av,
|
||||||
@ -268,7 +268,7 @@ ruleset_main(int ac, char **av)
|
|||||||
* can call call ioctl() for each of them.
|
* can call call ioctl() for each of them.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
rulespec_infp(FILE *fp, int cmd, devfs_rsnum rsnum)
|
rulespec_infp(FILE *fp, unsigned long request, devfs_rsnum rsnum)
|
||||||
{
|
{
|
||||||
struct devfs_rule dr;
|
struct devfs_rule dr;
|
||||||
char *line;
|
char *line;
|
||||||
@ -277,7 +277,7 @@ rulespec_infp(FILE *fp, int cmd, devfs_rsnum rsnum)
|
|||||||
assert(fp == stdin); /* XXX: De-hardcode "stdin" from error msg. */
|
assert(fp == stdin); /* XXX: De-hardcode "stdin" from error msg. */
|
||||||
while (efgetln(fp, &line)) {
|
while (efgetln(fp, &line)) {
|
||||||
rulespec_instr(&dr, line, rsnum);
|
rulespec_instr(&dr, line, rsnum);
|
||||||
rv = ioctl(mpfd, cmd, &dr);
|
rv = ioctl(mpfd, request, &dr);
|
||||||
if (rv == -1)
|
if (rv == -1)
|
||||||
err(1, "ioctl");
|
err(1, "ioctl");
|
||||||
free(line); /* efgetln() always malloc()s. */
|
free(line); /* efgetln() always malloc()s. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user