build on non-linux again

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@631 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Michael Gernoth 2004-03-05 09:36:49 +00:00
parent 1b6ced7cf4
commit 7becf22dce

View File

@ -8,9 +8,12 @@
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <linux/lp.h>
#include <errno.h> #include <errno.h>
#if defined(__linux__)
#include <linux/lp.h>
#endif
extern int errno; extern int errno;
extern RDPDR_DEVICE g_rdpdr_device[]; extern RDPDR_DEVICE g_rdpdr_device[];
@ -86,7 +89,10 @@ parallel_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 dispo
if (fcntl(parallel_fd, F_SETFL, O_NONBLOCK) == -1) if (fcntl(parallel_fd, F_SETFL, O_NONBLOCK) == -1)
perror("fcntl"); perror("fcntl");
#if defined(LPABORT)
/* Retry on errors */
ioctl(parallel_fd, LPABORT, (int) 1); ioctl(parallel_fd, LPABORT, (int) 1);
#endif
g_rdpdr_device[device_id].handle = parallel_fd; g_rdpdr_device[device_id].handle = parallel_fd;
@ -134,11 +140,13 @@ parallel_write(HANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32
default: default:
rc = STATUS_DEVICE_POWERED_OFF; rc = STATUS_DEVICE_POWERED_OFF;
} }
#if defined(LPGETSTATUS)
if (ioctl(handle, LPGETSTATUS, &status) == 0) if (ioctl(handle, LPGETSTATUS, &status) == 0)
{ {
/* coming soon: take care for the printer status */ /* coming soon: take care for the printer status */
printf("parallel_write: status = %d, errno = %d\n", status, errno); printf("parallel_write: status = %d, errno = %d\n", status, errno);
} }
#endif
} }
*result = n; *result = n;
return rc; return rc;