projects
/
debian
/
gcpegg
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge 64-bit fixes from Fernando Lucas Rodriguez <fernando_lr@terra.es>
[debian/gcpegg]
/
regtest.c
diff --git
a/regtest.c
b/regtest.c
index e4b5123fe3945907761a8c201039b5aaca1a3618..397dd60e128b8716f98f41409e6ee84008fae5c8 100644
(file)
--- a/
regtest.c
+++ b/
regtest.c
@@
-10,6
+10,10
@@
#define __USE_BSD
#include <errno.h>
#undef __USE_BSD
#define __USE_BSD
#include <errno.h>
#undef __USE_BSD
+#if defined(__FreeBSD_kernel__)
+/* Not patching the code directly, used once, in a "|" context */
+#define O_NDELAY 0
+#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/stat.h>
@@
-49,14
+53,16
@@
int main(int argc, char *argv[]) {
}
if ((TTY_fd = open(argv[1], O_RDWR | O_NDELAY)) < 0) {
}
if ((TTY_fd = open(argv[1], O_RDWR | O_NDELAY)) < 0) {
- fprintf(stderr, "%s: %s\n", argv[1], s
ys_errlist[errno]
);
+ fprintf(stderr, "%s: %s\n", argv[1], s
trerror(errno)
);
exit(1);
}
res = tcgetattr(TTY_fd, &tt);
res = cfsetospeed(&tt, baud);
cfmakeraw(&tt);
exit(1);
}
res = tcgetattr(TTY_fd, &tt);
res = cfsetospeed(&tt, baud);
cfmakeraw(&tt);
+#if !defined(__FreeBSD_kernel__)
tt.c_oflag &= (~(TABDLY | ONLCR));
tt.c_oflag &= (~(TABDLY | ONLCR));
+#endif
res = tcsetattr(TTY_fd, TCSANOW, &tt);
mean = 0;
res = tcsetattr(TTY_fd, TCSANOW, &tt);
mean = 0;