diff options
author | mat <mat@FreeBSD.org> | 2016-07-26 16:51:15 +0000 |
---|---|---|
committer | mat <mat@FreeBSD.org> | 2016-07-26 16:51:15 +0000 |
commit | adb4aaf11c0c2583174888ef2c1f62558623e96f (patch) | |
tree | 9b071a8105704e992946dcd6b801e9fcb7635142 /audio/xoscope/files/patch-ser__unix.c | |
parent | 2dd96c54d0c9b33bb5e3da26df7955f3ef3d86c5 (diff) | |
download | FreeBSD-ports-adb4aaf11c0c2583174888ef2c1f62558623e96f.zip FreeBSD-ports-adb4aaf11c0c2583174888ef2c1f62558623e96f.tar.gz |
Cleanup patches, a* categories.
Rename them to follow the make makepatch naming, and regenerate them.
With hat: portmgr
Sponsored by: Absolight
Diffstat (limited to 'audio/xoscope/files/patch-ser__unix.c')
-rw-r--r-- | audio/xoscope/files/patch-ser__unix.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/audio/xoscope/files/patch-ser__unix.c b/audio/xoscope/files/patch-ser__unix.c new file mode 100644 index 0000000..bee2d69 --- /dev/null +++ b/audio/xoscope/files/patch-ser__unix.c @@ -0,0 +1,74 @@ +--- ser_unix.c.orig 2008-12-17 17:46:15 UTC ++++ ser_unix.c +@@ -14,7 +14,14 @@ + #include <errno.h> + #include <unistd.h> + #include <string.h> ++#if (defined(__unix__) || defined(unix)) && !defined(USG) ++#include <sys/param.h> ++#endif ++#ifdef BSD ++#include <termios.h> ++#else + #include <termio.h> ++#endif + #include <fcntl.h> + #include <sys/types.h> + #include <sys/ioctl.h> +@@ -24,7 +31,11 @@ + + char device[512] = ""; /* Serial device */ + int sflags; ++#ifdef BSD ++struct termios stbuf, svbuf; /* termios: svbuf=saved, stbuf=set */ ++#else + struct termio stbuf, svbuf; /* termios: svbuf=saved, stbuf=set */ ++#endif + + char serial_error[256]; + +@@ -68,7 +79,11 @@ void + cleanup_serial(int fd) + { + if (fd > 0) { ++#ifdef BSD ++ if (tcsetattr(fd, TCSANOW, &svbuf) < 0 ) { ++#else + if (ioctl(fd, TCSETA, &svbuf) < 0) { ++#endif + /* sprintf(serial_error, "Can't ioctl set device %s", device); */ + /* perror(error); */ + } +@@ -86,12 +101,20 @@ findscope(char *dev, int i) + sprintf(serial_error, "%s %s", dev, strerror(errno)); + return(0); + } ++#ifdef BSD ++ if (tcgetattr(fd, &svbuf) < 0) { /* save settings */ ++#else + if (ioctl(fd, TCGETA, &svbuf) < 0) { /* save settings */ ++#endif + sprintf(serial_error, "%s Can't ioctl TCGETA", dev); + close(fd); + return(0); + } ++#ifdef BSD ++ if (tcsetattr(fd, TCSANOW, &stbuf) < 0) { ++#else + if (ioctl(fd, TCSETA, &stbuf) < 0) { ++#endif + sprintf(serial_error, "%s Can't ioctl TCSETA", dev); + close(fd); + return(0); +@@ -101,7 +124,11 @@ findscope(char *dev, int i) + return (1); /* serial port scope found! */ + } + ++#ifdef BSD ++ if (tcsetattr(fd, TCSANOW, &svbuf) < 0) { /* restore settings */ ++#else + if (ioctl(fd, TCSETA, &svbuf) < 0) { /* restore settings */ ++#endif + #if 0 + sprintf(serial_error, "Can't ioctl (set) %s", dev); + close(fd); |