[Midnightbsd-cvs] src [9240] trunk: fix issues with telnetd login(1) issues
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Tue Dec 13 20:52:53 EST 2016
Revision: 9240
http://svnweb.midnightbsd.org/src/?rev=9240
Author: laffer1
Date: 2016-12-13 20:52:53 -0500 (Tue, 13 Dec 2016)
Log Message:
-----------
fix issues with telnetd login(1) issues
Modified Paths:
--------------
trunk/contrib/telnet/telnetd/sys_term.c
trunk/gnu/usr.bin/cc/include/Makefile
trunk/lib/clang/include/Makefile
trunk/share/mk/bsd.compiler.mk
trunk/tools/build/make_check/Makefile
Modified: trunk/contrib/telnet/telnetd/sys_term.c
===================================================================
--- trunk/contrib/telnet/telnetd/sys_term.c 2016-11-11 23:18:16 UTC (rev 9239)
+++ trunk/contrib/telnet/telnetd/sys_term.c 2016-12-14 01:52:53 UTC (rev 9240)
@@ -1211,7 +1211,7 @@
*/
argv = (char **)malloc(sizeof(*argv) * 12);
if (argv == NULL)
- return(NULL);
+ fatal(net, "failure allocating argument space");
*argv++ = (char *)10;
*argv = (char *)0;
}
@@ -1222,11 +1222,12 @@
*argv = (char *)((long)(*argv) + 10);
argv = (char **)realloc(argv, sizeof(*argv)*((long)(*argv) + 2));
if (argv == NULL)
- return(NULL);
+ fatal(net, "failure allocating argument space");
argv++;
cpp = &argv[(long)argv[-1] - 10];
}
- *cpp++ = strdup(val);
+ if ((*cpp++ = strdup(val)) == NULL)
+ fatal(net, "failure allocating argument space");
*cpp = 0;
return(argv);
}
Modified: trunk/gnu/usr.bin/cc/include/Makefile
===================================================================
--- trunk/gnu/usr.bin/cc/include/Makefile 2016-11-11 23:18:16 UTC (rev 9239)
+++ trunk/gnu/usr.bin/cc/include/Makefile 2016-12-14 01:52:53 UTC (rev 9240)
@@ -1,4 +1,4 @@
-# $MidnightBSD: src/gnu/usr.bin/cc/include/Makefile,v 1.2 2009/05/22 00:51:38 laffer1 Exp $
+# $MidnightBSD$
# $FreeBSD: src/gnu/usr.bin/cc/include/Makefile,v 1.9 2007/05/19 04:25:59 kan Exp $
.include "../Makefile.inc"
@@ -16,6 +16,4 @@
@cp ${.ALLSRC} ${.TARGET}
CLEANFILES+= mm_malloc.h
-.include <bsd.init.mk>
-.include <bsd.incs.mk>
-.include <bsd.obj.mk>
+.include <bsd.prog.mk>
Modified: trunk/lib/clang/include/Makefile
===================================================================
--- trunk/lib/clang/include/Makefile 2016-11-11 23:18:16 UTC (rev 9239)
+++ trunk/lib/clang/include/Makefile 2016-12-14 01:52:53 UTC (rev 9240)
@@ -36,6 +36,4 @@
xmmintrin.h \
xopintrin.h
-.include <bsd.init.mk>
-.include <bsd.incs.mk>
-.include <bsd.obj.mk>
+.include <bsd.prog.mk>
Modified: trunk/share/mk/bsd.compiler.mk
===================================================================
--- trunk/share/mk/bsd.compiler.mk 2016-11-11 23:18:16 UTC (rev 9239)
+++ trunk/share/mk/bsd.compiler.mk 2016-12-14 01:52:53 UTC (rev 9240)
@@ -1,26 +1,52 @@
# $MidnightBSD$
+# Setup variables for the compiler
+#
+# COMPILER_TYPE is the major type of compiler. Currently gcc and clang support
+# automatic detection. Other compiler types can be shoe-horned in, but require
+# explicit setting of the compiler type. The compiler type can also be set
+# explicitly if, say, you install gcc as clang...
+#
+# COMPILER_VERSION is a numeric constant equal to:
+# major * 10000 + minor * 100 + tiny
+# It too can be overriden on the command line. When testing it, be sure to
+# make sure that you are limiting the test to a specific compiler. Testing
+# against 30300 for gcc likely isn't what you wanted (since versions of gcc
+# prior to 4.2 likely have no prayer of working).
+#
+# COMPILER_FEATURES will contain one or more of the following, based on
+# compiler support for that feature:
+#
+# - c++11 : supports full (or nearly full) C++11 programming environment.
+#
+# This file may be included multiple times, but only has effect the first time.
+#
+
+.if !defined(COMPILER_TYPE) || !defined(COMPILER_VERSION)
+_v!= ${CC} --version 2>/dev/null || echo 0.0.0
.if !defined(COMPILER_TYPE)
-. if ${CC:T:Mgcc*}
+. if ${CC:T:M*gcc*}
COMPILER_TYPE:= gcc
-. elif ${CC:T:Mclang}
+. elif ${CC:T:M*clang*}
COMPILER_TYPE:= clang
-. else
-_COMPILER_VERSION!= ${CC} --version
-. if ${_COMPILER_VERSION:Mgcc}
+. elif ${_v:Mgcc}
COMPILER_TYPE:= gcc
-. elif ${_COMPILER_VERSION:M\(GCC\)}
+. elif ${_v:M\(GCC\)}
COMPILER_TYPE:= gcc
-. elif ${_COMPILER_VERSION:Mclang}
+. elif ${_v:Mclang}
COMPILER_TYPE:= clang
-. else
-.error Unable to determine compiler type for ${CC}
-. endif
-. undef _COMPILER_VERSION
+. else
+.error Unable to determine compiler type for ${CC}. Consider setting COMPILER_TYPE.
. endif
.endif
+.if !defined(COMPILER_VERSION)
+COMPILER_VERSION!=echo "${_v:M[1-9].[0-9]*}" | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}'
+.endif
+.undef _v
+.endif
-.if ${COMPILER_TYPE} == "clang"
+.if ${COMPILER_TYPE} == "clang" || \
+ (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40800)
COMPILER_FEATURES= c++11
.else
COMPILER_FEATURES=
Modified: trunk/tools/build/make_check/Makefile
===================================================================
--- trunk/tools/build/make_check/Makefile 2016-11-11 23:18:16 UTC (rev 9239)
+++ trunk/tools/build/make_check/Makefile 2016-12-14 01:52:53 UTC (rev 9240)
@@ -23,7 +23,7 @@
all:
@echo '1..17'
- @${SMAKE} C_check || { cd ${.CURDIR} ; ${MAKE} failure ; }
+ @${SMAKE} C_check || { ${MAKE} -C ${.CURDIR} failure ; }
@echo "ok 1 - C_check # Test of -C flag existence detected no regression."
@echo 1:${DATA1} 2:${DATA2} 3:${DATA3} 4:${DATA4} 5:${DATA5} | \
diff -u ${.CURDIR}/regress.variables.out - || \
@@ -153,8 +153,13 @@
@${SMAKE} CMD1=cmd1 CMD2=cmd2 pass_cmd_vars_4
.endif
+#
+# Check that the variable definition arrived from the calling make
+#
.if make(pass_cmd_vars_1)
-# Check that the variable definition arrived from the calling make
+# These values should get overridden by the commandline
+CMD1=oops1
+CMD2=oops2
pass_cmd_vars_1:
@:
@@ -161,18 +166,8 @@
.if ${CMD1} != cmd1 || ${CMD2} != cmd2
.error variables not passed through MAKEFLAGS
.endif
-
-# Check that the variable definition is in MAKEFLAGS
-.if ${.MAKEFLAGS:MCMD1=*} != "CMD1=cmd1" || ${.MAKEFLAGS:MCMD2=*} != "CMD2=cmd2"
-.error variable assignment not found in $${MAKEFLAGS}
.endif
-# Check that the variable definition is not in MFLAGS
-.if ${MFLAGS:MCMD1=*} != "" || ${MFLAGS:MCMD2=*} != ""
-.error variable assignment found in $${MFLAGS}
-.endif
-.endif
-
.if make(pass_cmd_vars_2)
# Check that we cannot override the passed variables
CMD1=foo1
@@ -229,7 +224,7 @@
#
.if make(plus_flag)
OUT != ${SMAKE} -n plus_flag_1
-.if ${OUT} != "/tmp"
+.if ${OUT:M/tmp} != "/tmp"
.error make doesn't handle + flag
.endif
plus_flag:
More information about the Midnightbsd-cvs
mailing list