tty_subs.c (b97fa2ef508bb1cc99621edb8b6d03845b55b8bd) | tty_subs.c (a885d9dcf9631f6bc175a29bf5427c8218d1fbea) |
---|---|
1/*- 2 * Copyright (c) 1992 Keith Muller. 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Keith Muller of the University of California, San Diego. 8 * --- 20 unchanged lines hidden (view full) --- 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * | 1/*- 2 * Copyright (c) 1992 Keith Muller. 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Keith Muller of the University of California, San Diego. 8 * --- 20 unchanged lines hidden (view full) --- 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * |
37 * $Id$ | 37 * $Id: tty_subs.c,v 1.6 1997/02/22 14:04:47 peter Exp $ |
38 */ 39 40#ifndef lint 41static char const sccsid[] = "@(#)tty_subs.c 8.2 (Berkeley) 4/18/94"; 42#endif /* not lint */ 43 44#include <sys/types.h> 45#include <sys/time.h> --- 42 unchanged lines hidden (view full) --- 88 if ((ttyinf = fdopen(ttyfd, "r")) != NULL) 89 return(0); 90 (void)fclose(ttyoutf); 91 } 92 (void)close(ttyfd); 93 } 94 95 if (iflag) { | 38 */ 39 40#ifndef lint 41static char const sccsid[] = "@(#)tty_subs.c 8.2 (Berkeley) 4/18/94"; 42#endif /* not lint */ 43 44#include <sys/types.h> 45#include <sys/time.h> --- 42 unchanged lines hidden (view full) --- 88 if ((ttyinf = fdopen(ttyfd, "r")) != NULL) 89 return(0); 90 (void)fclose(ttyoutf); 91 } 92 (void)close(ttyfd); 93 } 94 95 if (iflag) { |
96 warn(1, "Fatal error, cannot open %s", DEVTTY); | 96 pax_warn(1, "Fatal error, cannot open %s", DEVTTY); |
97 return(-1); 98 } 99 return(0); 100} 101 102/* 103 * tty_prnt() 104 * print a message using the specified format to the controlling tty --- 51 unchanged lines hidden (view full) --- 156 * strip off that trailing newline 157 */ 158 if ((pt = strchr(str, '\n')) != NULL) 159 *pt = '\0'; 160 return(0); 161} 162 163/* | 97 return(-1); 98 } 99 return(0); 100} 101 102/* 103 * tty_prnt() 104 * print a message using the specified format to the controlling tty --- 51 unchanged lines hidden (view full) --- 156 * strip off that trailing newline 157 */ 158 if ((pt = strchr(str, '\n')) != NULL) 159 *pt = '\0'; 160 return(0); 161} 162 163/* |
164 * warn() 165 * write a warning message to stderr. if "set" the exit value of pax | 164 * pax_warn() 165 * write a pax_warning message to stderr. if "set" the exit value of pax |
166 * will be non-zero. 167 */ 168 169#if __STDC__ 170void | 166 * will be non-zero. 167 */ 168 169#if __STDC__ 170void |
171warn(int set, char *fmt, ...) | 171pax_warn(int set, char *fmt, ...) |
172#else 173void | 172#else 173void |
174warn(set, fmt, va_alist) | 174pax_warn(set, fmt, va_alist) |
175 int set; 176 char *fmt; 177 va_dcl 178#endif 179{ 180 va_list ap; 181# if __STDC__ 182 va_start(ap, fmt); --- 12 unchanged lines hidden (view full) --- 195 } 196 (void)fprintf(stderr, "%s: ", argv0); 197 (void)vfprintf(stderr, fmt, ap); 198 va_end(ap); 199 (void)fputc('\n', stderr); 200} 201 202/* | 175 int set; 176 char *fmt; 177 va_dcl 178#endif 179{ 180 va_list ap; 181# if __STDC__ 182 va_start(ap, fmt); --- 12 unchanged lines hidden (view full) --- 195 } 196 (void)fprintf(stderr, "%s: ", argv0); 197 (void)vfprintf(stderr, fmt, ap); 198 va_end(ap); 199 (void)fputc('\n', stderr); 200} 201 202/* |
203 * syswarn() 204 * write a warning message to stderr. if "set" the exit value of pax | 203 * sys_warn() 204 * write a pax_warning message to stderr. if "set" the exit value of pax |
205 * will be non-zero. 206 */ 207 208#if __STDC__ 209void | 205 * will be non-zero. 206 */ 207 208#if __STDC__ 209void |
210syswarn(int set, int errnum, char *fmt, ...) | 210sys_warn(int set, int errnum, char *fmt, ...) |
211#else 212void | 211#else 212void |
213syswarn(set, errnum, fmt, va_alist) | 213sys_warn(set, errnum, fmt, va_alist) |
214 int set; 215 int errnum; 216 char *fmt; 217 va_dcl 218#endif 219{ 220 va_list ap; 221# if __STDC__ --- 25 unchanged lines hidden --- | 214 int set; 215 int errnum; 216 char *fmt; 217 va_dcl 218#endif 219{ 220 va_list ap; 221# if __STDC__ --- 25 unchanged lines hidden --- |