Fixed breakage of the formatting operation in rev.1.266. The wrong
clause of an if-else statement was removed. Reviewed by: no response from maintainer in 12 days
This commit is contained in:
parent
b4f00e0bb7
commit
a3a10d1c3c
@ -2600,9 +2600,16 @@ fdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
|
||||
return (0);
|
||||
|
||||
case FD_STYPE: /* set drive type */
|
||||
if (suser(td) != 0)
|
||||
return (EPERM);
|
||||
/*
|
||||
* Allow setting drive type temporarily iff
|
||||
* currently unset. Used for fdformat so any
|
||||
* user can set it, and then start formatting.
|
||||
*/
|
||||
if (fd->ft)
|
||||
return (EINVAL); /* already set */
|
||||
fd->fts[0] = *(struct fd_type *)addr;
|
||||
fd->ft = &fd->fts[0];
|
||||
fd->flags |= FD_UA;
|
||||
return (0);
|
||||
|
||||
case FD_GOPTS: /* get drive options */
|
||||
|
11
sys/isa/fd.c
11
sys/isa/fd.c
@ -2600,9 +2600,16 @@ fdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
|
||||
return (0);
|
||||
|
||||
case FD_STYPE: /* set drive type */
|
||||
if (suser(td) != 0)
|
||||
return (EPERM);
|
||||
/*
|
||||
* Allow setting drive type temporarily iff
|
||||
* currently unset. Used for fdformat so any
|
||||
* user can set it, and then start formatting.
|
||||
*/
|
||||
if (fd->ft)
|
||||
return (EINVAL); /* already set */
|
||||
fd->fts[0] = *(struct fd_type *)addr;
|
||||
fd->ft = &fd->fts[0];
|
||||
fd->flags |= FD_UA;
|
||||
return (0);
|
||||
|
||||
case FD_GOPTS: /* get drive options */
|
||||
|
Loading…
Reference in New Issue
Block a user