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:
Bruce Evans 2004-04-25 04:33:56 +00:00
parent b4f00e0bb7
commit a3a10d1c3c
2 changed files with 18 additions and 4 deletions

View File

@ -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 */

View File

@ -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 */