*** linux2300.c	Mon Sep  1 15:03:58 2008
--- linux2300.c-new	Mon Sep  1 15:01:42 2008
***************
*** 29,38 ****
  {
  	WEATHERSTATION ws2300;
  	struct termios adtio;
! 	int portstatus, fdflags;
  
! 	//Setup serial port
  
  	if ((ws2300 = open(device, O_RDWR | O_NONBLOCK)) < 0)
  	{
  		printf("\nUnable to open serial device %s\n", device);
--- 29,46 ----
  {
  	WEATHERSTATION ws2300;
  	struct termios adtio;
! #ifdef __FreeBSD__
! 	int portstatus;
  
! 	if ((ws2300 = open(device, O_RDWR | O_NOCTTY)) < 0)
! 	{
! 		printf("\nUnable to open serial device %s\n", device);
! 		exit(EXIT_FAILURE);
! 	}
! 	tcgetattr(ws2300, &adtio);   // Commented out and replaced by the memset above
  
+ #else
+ 	int portstatus,fdflags;
  	if ((ws2300 = open(device, O_RDWR | O_NONBLOCK)) < 0)
  	{
  		printf("\nUnable to open serial device %s\n", device);
***************
*** 54,61 ****
  	//We want full control of what is set and simply reset the entire adtio struct
  	memset(&adtio, 0, sizeof(adtio));
  	
! 	//tcgetattr(ws2300, &adtio);   // Commented out and replaced by the memset above
! 	
  	// Serial control options
  	adtio.c_cflag &= ~PARENB;      // No parity
  	adtio.c_cflag &= ~CSTOPB;      // One stop bit
--- 62,68 ----
  	//We want full control of what is set and simply reset the entire adtio struct
  	memset(&adtio, 0, sizeof(adtio));
  	
! #endif	
  	// Serial control options
  	adtio.c_cflag &= ~PARENB;      // No parity
  	adtio.c_cflag &= ~CSTOPB;      // One stop bit
