Re: changing EINVAL for SIOCSIFCAP to something else
- From: Andre Oppermann <andre@xxxxxxxxxxx>
- Date: Mon, 27 Feb 2006 10:04:28 +0100
Gleb Smirnoff wrote:
Colleagues,
I'd like to replace the unpleasant one-for-all error code
EINVAL to something else in this part of code of
src/sys/net/if.c:ifhwioctl()
case SIOCSIFCAP:
error = suser(td);
if (error)
return (error);
if (ifp->if_ioctl == NULL)
return (EOPNOTSUPP);
if (ifr->ifr_reqcap & ~ifp->if_capabilities)
return (EINVAL);
IFF_LOCKGIANT(ifp);
error = (*ifp->if_ioctl)(ifp, cmd, data);
IFF_UNLOCKGIANT(ifp);
if (error == 0)
getmicrotime(&ifp->if_lastchange);
break;
The possible variants are:
#define ENODEV 19 /* Operation not supported by device */
#define ENOTTY 25 /* Inappropriate ioctl for device */
#define ENOPROTOOPT 42 /* Protocol not available */
#define EPROTONOSUPPORT 43 /* Protocol not supported */
I prefer this variant:
if (ifp->if_ioctl == NULL)
return (ENOTTY);
if (ifr->ifr_reqcap & ~ifp->if_capabilities)
return (ENODEV);
Any objections?
I don't think ENOTTY is appropriate here even though the comment to this
error code would fit. But the define still says no TTY which is totally
unrelated and confusing.
--
Andre
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: changing EINVAL for SIOCSIFCAP to something else
- From: Gleb Smirnoff
- Re: changing EINVAL for SIOCSIFCAP to something else
- References:
- changing EINVAL for SIOCSIFCAP to something else
- From: Gleb Smirnoff
- changing EINVAL for SIOCSIFCAP to something else
- Prev by Date: changing EINVAL for SIOCSIFCAP to something else
- Next by Date: Re: changing EINVAL for SIOCSIFCAP to something else
- Previous by thread: changing EINVAL for SIOCSIFCAP to something else
- Next by thread: Re: changing EINVAL for SIOCSIFCAP to something else
- Index(es):
Relevant Pages
|
|