[Git][NTPsec/ntpsec][master] 2 commits: Remove SAVE_ERRNO

Hal Murray gitlab at mg.gitlab.com
Tue Aug 9 06:08:16 UTC 2016


Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
e259d51e by Hal Murray at 2016-08-03T14:03:21-07:00
Remove SAVE_ERRNO

Was (maybe) used to get errno from wherever Windows keeps it
for %m in msyslog.  That is now done in msyslog.

- - - - -
eb20d61d by Hal Murray at 2016-08-03T14:03:21-07:00
Remove LDISC_ECHO, not used by any drivers.

- - - - -


3 changed files:

- include/ntp_stdlib.h
- include/ntp_tty.h
- ntpd/ntp_refclock.c


Changes:

=====================================
include/ntp_stdlib.h
=====================================
--- a/include/ntp_stdlib.h
+++ b/include/ntp_stdlib.h
@@ -49,17 +49,6 @@ extern	void	errno_to_str(int, char *, size_t);
 #define EVP_MAX_MD_SIZE	64	/* longest known is SHA512 */
 #endif
 
-#define SAVE_ERRNO(stmt)				\
-	{						\
-		int preserved_errno;			\
-							\
-		preserved_errno = socket_errno();	\
-		{					\
-			stmt				\
-		}					\
-		errno = preserved_errno;		\
-	}
-
 typedef void (*ctrl_c_fn)(void);
 
 /* authkeys.c */


=====================================
include/ntp_tty.h
=====================================
--- a/include/ntp_tty.h
+++ b/include/ntp_tty.h
@@ -31,7 +31,6 @@
 #define LDISC_CHU	0x008	/* depredated */
 #define LDISC_PPS	0x010	/* depredated */
 #define LDISC_RAW	0x020	/* raw binary */
-#define LDISC_ECHO	0x040	/* enable echo */
 #define	LDISC_REMOTE	0x080	/* remote mode */
 #define	LDISC_7O1	0x100	/* 7-bit, odd parity for Z3801A */
 


=====================================
ntpd/ntp_refclock.c
=====================================
--- a/ntpd/ntp_refclock.c
+++ b/ntpd/ntp_refclock.c
@@ -745,14 +745,10 @@ refclock_open(
 	/* refclock_open() long returned 0 on failure, avoid it. */
 	if (0 == fd) {
 		fd = dup(0);
-		SAVE_ERRNO(
-			close(0);
-		)
+		close(0);
 	}
 	if (fd < 0) {
-		SAVE_ERRNO(
-			msyslog(LOG_ERR, "refclock_open %s: %m", dev);
-		)
+		msyslog(LOG_ERR, "refclock_open %s: %m", dev);
 		return -1;
 	}
 	if (!refclock_setup(fd, speed, lflags)) {
@@ -800,11 +796,7 @@ refclock_setup(
 	 * POSIX serial line parameters (termios interface)
 	 */
 	if (tcgetattr(fd, ttyp) < 0) {
-		SAVE_ERRNO(
-			msyslog(LOG_ERR,
-				"refclock_setup fd %d tcgetattr: %m",
-				fd);
-		)
+		msyslog(LOG_ERR, "refclock_setup fd %d tcgetattr: %m", fd);
 		return false;
 	}
 
@@ -855,14 +847,8 @@ refclock_setup(
 		ttyp->c_iflag = 0;
 		ttyp->c_cc[VMIN] = 1;
 	}
-	if (lflags & LDISC_ECHO)
-		ttyp->c_lflag |= ECHO;
 	if (tcsetattr(fd, TCSANOW, ttyp) < 0) {
-		SAVE_ERRNO(
-			msyslog(LOG_ERR,
-				"refclock_setup fd %d TCSANOW: %m",
-				fd);
-		)
+		msyslog(LOG_ERR, "refclock_setup fd %d TCSANOW: %m", fd);
 		return false;
 	}
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/cdc5ae9ff4e79418bcb5a35e6073216eff81a466...eb20d61d59b738b85f3f7d6dc6dba955c1f75fe0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160809/5af73d97/attachment.html>


More information about the vc mailing list