--- tunelp.c~org	1995-01-13 02:34:15.000000000 -0800
+++ tunelp.c	2003-06-11 23:14:51.000000000 -0700
@@ -107,11 +107,13 @@
 
   fstat(fd, &statbuf);
 
+#if 0
   if((!S_ISCHR(statbuf.st_mode)) || (MAJOR(statbuf.st_rdev) != 6 )
      || (MINOR(statbuf.st_rdev) > 3)) {
     printf("%s: %s not an lp device.\n", argv[0], argv[1]);
     print_usage(progname);
   }
+#endif
 
   cmdst = cmds = mylloc(sizeof(struct command));
   cmds->next = 0;
@@ -192,8 +194,16 @@
   }
 
   /* Allow for binaries compiled under a new kernel to work on the old ones */
+#ifdef LPGETSTATUS
+  /* Use LPGETSTATUS if it's available, since usblp doesn't
+   * implement LPGETIRQ.
+   */
+  if (ioctl(fd, LPGETSTATUS, &status) < 0 && errno == EINVAL)
+    offset = 0x0600;	/* We don't understand the new ioctls */
+#else
   if (LPGETIRQ >= 0x0600 && ioctl(fd, LPGETIRQ) < 0 && errno == EINVAL)
     offset = 0x0600;	/* We don't understand the new ioctls */
+#endif
 
   cmds = cmdst;
   while (cmds->next) {
