Skip to contentSkip to conversation

fix: lp.c wrong return code

PATCH Walter Harms 2 participants 2 messages Feb 24, 2002

lore
Share & tools
lore
#0 lore raw

hi,
how takes care about the lp driver ? i saw some changes in the 2.4 but found no maintainer.
to the maintainer:
LPGETSTATS is strange. first you set LP_STAT then you delete it. maybe a EACCES (Permission denied) would do it ?

problem:
calling the ioctl( LPSETIRQ ) the driver returns EINVAL (Invalid argument)instead of ENOSYS.

Fix : return ENOSYS (Function not implemented)

NOTE:
if EINVAL is correct, you can delete the entiere entry, EINVAL in default.

lp.c renamed from lp.c.old +1 -1
@@ -806,7 +806,7 @@
 			LP_WAIT(minor) = arg;
 			break;
 		case LPSETIRQ: 
-			return -EINVAL;
+			return -ENOSYS;
 			break;
 		case LPGETIRQ:
 			if (copy_to_user((int *) arg, &LP_IRQ(minor),
#1 lore raw
Quoted 2 lines

calling the ioctl( LPSETIRQ ) the driver returns EINVAL (Invalid argument)instead of ENOSYS. Fix : return ENOSYS (Function not implemented)

ENOSYS is for a syscall not supported.

Quoted 1 line

if EINVAL is correct, you can delete the entiere entry, EINVAL in default.

It should actually be ENOTTY ...