$NetBSD$

--- lpdsrv.c.orig	2000-06-15 11:22:20.000000000 +0200
+++ lpdsrv.c	2011-01-18 21:07:44.222911688 +0100
@@ -70,6 +70,7 @@
  * Up to ten name:device pairs are supported for each queue type
  */
 
+#include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <sys/time.h>
@@ -80,7 +81,15 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <errno.h>
+#ifdef __sun
+#include <unistd.h>
+#endif
+#ifdef __linux__
 #include <linux/lp.h>
+#endif
+#ifndef LPRESET
+#define LPRESET 0x060c /* reset printer */
+#endif
 
 #define TBUF_LEN 1024
 #define QNAME_LEN 32
@@ -134,7 +143,8 @@
 int argc;
 char *argv[];
 	{
-	int i, j, sockfd, newsockfd, clilen, RejectNet;
+	int i, j, sockfd, newsockfd, RejectNet;
+	unsigned int clilen;
 	struct sockaddr_in CliAddr, ServAddr;
 	int TCPPort = 515;
 	int Timeout = 300;
