git://git.jankratochvil.net
/
gnokii.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This commit was manufactured by cvs2svn to create tag
[gnokii.git]
/
common
/
devices
/
unixserial.c
diff --git
a/common/devices/unixserial.c
b/common/devices/unixserial.c
index
7ad6128
..
bc7e37e
100644
(file)
--- a/
common/devices/unixserial.c
+++ b/
common/devices/unixserial.c
@@
-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(retcode==-1) {
perror("Gnokii serial_open:tcgetattr");
/* Don't call serial_close since serial_termios is not valid */
-#if 0
close(__fd);
return(-1);
close(__fd);
return(-1);
-#endif
}
return __fd;
}
return __fd;
@@
-110,7
+108,7
@@
int serial_opendevice(__const char *__file, int __with_odd_parity, int __with_as
/* Open device */
/* Open device */
- fd = serial_open(__file, O_RD
ONLY
| O_NOCTTY | O_NONBLOCK);
+ fd = serial_open(__file, O_RD
WR
| O_NOCTTY | O_NONBLOCK);
if (fd < 0)
return fd;
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)");
retcode = fcntl(fd, F_SETOWN, getpid());
if (retcode == -1){
perror("Gnokii serial_opendevice: fnctl(F_SETOWN)");
-#if 0
serial_close(fd);
return(-1);
serial_close(fd);
return(-1);
-#endif
}
#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)");
retcode=fcntl(fd, F_SETFL, FASYNC);
if (retcode == -1){
perror("Gnokii serial_opendevice: fnctl(F_SETFL)");
-#if 0
serial_close(fd);
return(-1);
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");
retcode=tcflush(fd, TCIFLUSH);
if (retcode == -1) {
perror("Gnokii serial_opendevice: tcflush");
-#if 0
serial_close(fd);
return(-1);
serial_close(fd);
return(-1);
-#endif
}
retcode=tcsetattr(fd, TCSANOW, &tp);
if (retcode == -1){
perror("Gnokii serial_opendevice: tcsetattr");
}
retcode=tcsetattr(fd, TCSANOW, &tp);
if (retcode == -1){
perror("Gnokii serial_opendevice: tcsetattr");
-#if 0
serial_close(fd);
return(-1);
serial_close(fd);
return(-1);
-#endif
}
return fd;
}
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) {
size_t serial_write(int __fd, __const __ptr_t __buf, size_t __n) {
-#if 0
return (write(__fd, __buf, __n));
return (write(__fd, __buf, __n));
-#endif
- return __n;
}
#endif /* WIN32 */
}
#endif /* WIN32 */