* Build.sh: bail out early if build failure
* Build.sh: fix manpage name * chvt.c: Solaris: chvt.c:57: `TIOCSCTTY' undeclared (first use in this function) * chvt.c: GNU/Linux: /tmp/ccrAeq0h.o(.text+0x5e): In function `chvt': : warning: warning: revoke is not implemented and will always fail * sh.h: let it only change to .section .comment ifdef __ELF__
This commit is contained in:
		
							
								
								
									
										5
									
								
								Build.sh
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								Build.sh
									
									
									
									
									
								
							| @@ -1,5 +1,5 @@ | |||||||
| #!/bin/sh | #!/bin/sh | ||||||
| # $MirBSD: Build.sh,v 1.14 2004/11/10 17:13:10 tg Exp $ | # $MirBSD: Build.sh,v 1.15 2004/11/10 19:58:06 tg Exp $ | ||||||
| #- | #- | ||||||
| # Copyright (c) 2004 | # Copyright (c) 2004 | ||||||
| #	Thorsten "mirabile" Glaser <x86@ePost.de> | #	Thorsten "mirabile" Glaser <x86@ePost.de> | ||||||
| @@ -56,9 +56,10 @@ if test -e strlfun.c; then | |||||||
| 	$SHELL ./emacs-gen.sh emacs.c >emacs.out | 	$SHELL ./emacs-gen.sh emacs.c >emacs.out | ||||||
| 	echo "Building..." | 	echo "Building..." | ||||||
| 	$CC $COPTS $CFLAGS $CPPFLAGS $LDFLAGS -o ksh.unstripped *.c | 	$CC $COPTS $CFLAGS $CPPFLAGS $LDFLAGS -o ksh.unstripped *.c | ||||||
|  | 	test -e ksh.unstripped || exit 1 | ||||||
| 	echo "Finalizing..." | 	echo "Finalizing..." | ||||||
| 	tbl <ksh.1tbl >mksh.1 || cat ksh.1tbl >mksh.1 | 	tbl <ksh.1tbl >mksh.1 || cat ksh.1tbl >mksh.1 | ||||||
| 	nroff -mdoc -Tascii <ksh.1 >mksh.cat1 || rm -f mksh.cat1 | 	nroff -mdoc -Tascii <mksh.1 >mksh.cat1 || rm -f mksh.cat1 | ||||||
| 	man=mksh.cat1 | 	man=mksh.cat1 | ||||||
| 	test -s $man || man=mksh.1 | 	test -s $man || man=mksh.1 | ||||||
| 	test -s $man || man=ksh.1tbl | 	test -s $man || man=ksh.1tbl | ||||||
|   | |||||||
							
								
								
									
										20
									
								
								chvt.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								chvt.c
									
									
									
									
									
								
							| @@ -1,15 +1,15 @@ | |||||||
| /**	$MirBSD: chvt.c,v 1.1 2004/10/31 22:28:41 tg Exp $ */ | /**	$MirBSD: chvt.c,v 1.2 2004/11/10 19:58:06 tg Exp $ */ | ||||||
|  |  | ||||||
| /*- | /*- | ||||||
|  * Copyright (c) 2004 |  * Copyright (c) 2004 | ||||||
|  *	Thorsten "mirabile" Glaser <tg@66h.42h.de> |  *	Thorsten "mirabile" Glaser <tg@66h.42h.de> | ||||||
|  * |  * | ||||||
|  * Licensee is hereby permitted to deal in this work without restric- |  * Licensee is hereby permitted to deal in this work without restric- | ||||||
|  * tion, including unlimited rights to use, publically perform, modi- |  * tion, including unlimited rights to use, publicly perform, modify, | ||||||
|  * fy, merge, distribute, sell, give away or sublicence, provided the |  * merge, distribute, sell, give away or sublicence, provided all co- | ||||||
|  * above copyright notices, these terms and the disclaimer are retai- |  * pyright notices above, these terms and the disclaimer are retained | ||||||
|  * ned in all redistributions, or reproduced in accompanying documen- |  * in all redistributions or reproduced in accompanying documentation | ||||||
|  * tation or other materials provided with binary redistributions. |  * or other materials provided with binary redistributions. | ||||||
|  * |  * | ||||||
|  * Licensor hereby provides this work "AS IS" and WITHOUT WARRANTY of |  * Licensor hereby provides this work "AS IS" and WITHOUT WARRANTY of | ||||||
|  * any kind, expressed or implied, to the maximum extent permitted by |  * any kind, expressed or implied, to the maximum extent permitted by | ||||||
| @@ -24,20 +24,23 @@ | |||||||
| #include <sys/ioctl.h> | #include <sys/ioctl.h> | ||||||
| #include "ksh_stat.h" | #include "ksh_stat.h" | ||||||
|  |  | ||||||
| __RCSID("$MirBSD: chvt.c,v 1.1 2004/10/31 22:28:41 tg Exp $"); | __RCSID("$MirBSD: chvt.c,v 1.2 2004/11/10 19:58:06 tg Exp $"); | ||||||
|  |  | ||||||
|  |  | ||||||
| char * | char * | ||||||
| chvt(char *f) | chvt(char *f) | ||||||
| { | { | ||||||
|  | #ifdef TIOCSCTTY | ||||||
| 	int fd; | 	int fd; | ||||||
|  |  | ||||||
| 	if (chown(f, 0, 0)) | 	if (chown(f, 0, 0)) | ||||||
| 		return "chown"; | 		return "chown"; | ||||||
| 	if (chmod(f, 0600)) | 	if (chmod(f, 0600)) | ||||||
| 		return "chmod"; | 		return "chmod"; | ||||||
|  | #ifndef linux | ||||||
| 	if (revoke(f)) | 	if (revoke(f)) | ||||||
| 		return "revoke"; | 		return "revoke"; | ||||||
|  | #endif | ||||||
|  |  | ||||||
| 	if ((fd = open(f, O_RDWR)) == -1) { | 	if ((fd = open(f, O_RDWR)) == -1) { | ||||||
| 		sleep(1); | 		sleep(1); | ||||||
| @@ -63,4 +66,7 @@ chvt(char *f) | |||||||
| 		close(fd); | 		close(fd); | ||||||
|  |  | ||||||
| 	return NULL; | 	return NULL; | ||||||
|  | #else | ||||||
|  | 	return "TIOCSCTTY not implemented"; | ||||||
|  | #endif | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										6
									
								
								sh.h
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								sh.h
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| /**	$MirBSD: sh.h,v 1.18 2004/11/10 17:31:38 tg Exp $ */ | /**	$MirBSD: sh.h,v 1.19 2004/11/10 19:58:06 tg Exp $ */ | ||||||
| /*	$OpenBSD: sh.h,v 1.18 2004/05/31 10:36:35 otto Exp $	*/ | /*	$OpenBSD: sh.h,v 1.18 2004/05/31 10:36:35 otto Exp $	*/ | ||||||
|  |  | ||||||
| #ifndef SH_H | #ifndef SH_H | ||||||
| @@ -723,8 +723,12 @@ EXTERN	int	x_cols I__(80);	/* tty columns */ | |||||||
| #undef I__ | #undef I__ | ||||||
|  |  | ||||||
| #ifndef __RCSID | #ifndef __RCSID | ||||||
|  | #ifdef __ELF__ | ||||||
| #define __RCSID(x)	static const char __rcsid[] \ | #define __RCSID(x)	static const char __rcsid[] \ | ||||||
| 			GCC_FUNC_ATTR(section(".comment")) = (x) | 			GCC_FUNC_ATTR(section(".comment")) = (x) | ||||||
|  | #else | ||||||
|  | #define __RCSID(x)	static const char __rcsid[] = (x) | ||||||
|  | #endif | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #endif	/* ndef SH_H */ | #endif	/* ndef SH_H */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user