This commit was manufactured by cvs2svn to create tag 'bp_uc'.
[gnokii.git] / common / devices / unixserial.c
index 7ad6128..bc7e37e 100644 (file)
@@ -81,10 +81,8 @@ int serial_open(__const char *__file, int __oflag) {
   if(retcode==-1) {
     perror("Gnokii serial_open:tcgetattr");
     /* Don't call serial_close since serial_termios is not valid */
-#if 0
     close(__fd);
     return(-1);
-#endif
   }
   
   return __fd;
@@ -110,7 +108,7 @@ int serial_opendevice(__const char *__file, int __with_odd_parity, int __with_as
 
   /* Open device */
 
-  fd = serial_open(__file, O_RDONLY | O_NOCTTY | O_NONBLOCK);
+  fd = serial_open(__file, O_RDWR | O_NOCTTY | O_NONBLOCK);
 
   if (fd < 0) 
     return fd;
@@ -121,10 +119,8 @@ int serial_opendevice(__const char *__file, int __with_odd_parity, int __with_as
   retcode = fcntl(fd, F_SETOWN, getpid());
   if (retcode == -1){
     perror("Gnokii serial_opendevice: fnctl(F_SETOWN)");
-#if 0
     serial_close(fd);
     return(-1);
-#endif
   }
 #endif
 
@@ -134,10 +130,8 @@ int serial_opendevice(__const char *__file, int __with_odd_parity, int __with_as
     retcode=fcntl(fd, F_SETFL, FASYNC);
     if (retcode == -1){
       perror("Gnokii serial_opendevice: fnctl(F_SETFL)");
-#if 0
       serial_close(fd);
       return(-1);
-#endif
     }
   }
   
@@ -167,19 +161,15 @@ int serial_opendevice(__const char *__file, int __with_odd_parity, int __with_as
   retcode=tcflush(fd, TCIFLUSH);
   if (retcode == -1) {
     perror("Gnokii serial_opendevice: tcflush");
-#if 0
     serial_close(fd);
     return(-1);
-#endif
   }
 
   retcode=tcsetattr(fd, TCSANOW, &tp);
   if (retcode == -1){
     perror("Gnokii serial_opendevice: tcsetattr");
-#if 0
     serial_close(fd);
     return(-1);
-#endif
   }
 
   return fd;
@@ -270,10 +260,7 @@ size_t serial_read(int __fd, __ptr_t __buf, size_t __nbytes) {
 
 size_t serial_write(int __fd, __const __ptr_t __buf, size_t __n) {
        
-#if 0
        return (write(__fd, __buf, __n));
-#endif
-       return __n;
 }
 
 #endif  /* WIN32 */