/* $NetBSD: error.c,v 1.6 2003/08/07 11:17:25 agc Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Edward Wang at The University of California, Berkeley. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include #ifndef lint #if 0 static char sccsid[] = "@(#)error.c 8.1 (Berkeley) 6/6/93"; #else __RCSID("$NetBSD: error.c,v 1.6 2003/08/07 11:17:25 agc Exp $"); #endif #endif /* not lint */ #include "defs.h" #include "context.h" #include "char.h" #define ERRLINES 10 /* number of lines for errwin */ void error(const char *fmt, ...) { va_list ap; va_start(ap, fmt); verror(fmt, ap); va_end(ap); } void verror(const char *fmt, va_list ap) { struct context *x; struct ww *w; for (x = &cx; x != 0 && x->x_type != X_FILE; x = x->x_link) ; if (x == 0) { if (terse) wwbell(); else { wwvprintf(cmdwin, fmt, ap); wwputs(" ", cmdwin); } return; } if (x->x_noerr) return; if ((w = x->x_errwin) == 0) { char buf[512]; (void) snprintf(buf, sizeof(buf), "Errors from %s", x->x_filename); if ((w = x->x_errwin = openiwin(ERRLINES, buf)) == 0) { wwputs("Can't open error window. ", cmdwin); x->x_noerr = 1; return; } } if (more(w, 0) == 2) { x->x_noerr = 1; return; } wwprintf(w, "line %d: ", x->x_lineno); wwvprintf(w, fmt, ap); wwputc('\n', w); } void err_end(void) { if (cx.x_type == X_FILE && cx.x_errwin != 0) { if (!cx.x_noerr) waitnl(cx.x_errwin); closeiwin(cx.x_errwin); cx.x_errwin = 0; } } -15Remove/ifdef unused variablesmartin 2011-08-01According to the Oxford Dictionary of Etymology, a wether is a male sheepmbalmer 2006-11-16__unused removal on arguments; approved by core.christos 2006-10-12- sprinkle __unused on function decls.christos 2006-04-26un-bitrot some of this code (which is not included by default in kernels),oster 2005-12-11merge ktrace-lwp.christos 2005-09-24Remove an RF_ASSERT that is just plain wrong.oster 2005-02-27nuke trailing whitespaceperry 2004-04-09These changes complete the effective removal of malloc() from alloster 2004-03-23Partially back out some changes that were causing grief withoster 2004-03-21Add in a couple of missed foo=foo->next's.oster 2004-03-20Change signature of rf_AllocBuffer() to take a dag_h and buffer sizeoster 2004-03-20For each RAID set, pre-allocate a number of "emergency buffers" to beoster 2004-03-19Take care of six more mallocs:oster 2004-03-18- Introduce a 'dagnode' pool. Initialize it and allow for cleanup.oster 2004-03-06Sprinkle a few #if's to ignore some bits that are only used for RAID 6 or PQ ...oster 2004-03-05Introduce RF_DEBUG_DAG and use it to #if-out rf_dagDebug sections.oster 2004-01-10iCleanup the RF_CREATE_PARAM3(). Middle two "arguments" were nothingoster 2003-12-30Some days you wonder if some of the function declaration consistencyoster 2003-12-29- first kick at a major reworking of RAIDframe's memory allocation code:oster 2003-12-29[Having received a definite lack of strenuous objection, a small amountoster 2002-08-02- remove "#include "rf_memchunk.h"oster 2002-05-22bcopy -> memcpy. Reviewed by Greg Oster.wiz 2001-11-13add RCSIDslukem 2001-10-04Step 2 of the disentanglement. We now look to <dev/raidframe/*> foroster 2001-09-01Disable all of the RF_ASSERT()s by default, enabling them if thethorpej 2001-01-26Various parts of this file are only needed by the even/odd and PQoster 2000-01-07Nuke: #include "rf_threadid.h".oster 1999-08-13rf_sys.h does not need to be #included in any of these files, and, actually,oster 1999-02-05Phase 2 of the RAIDframe cleanup. The source is now closer to KNFoster 1999-01-26RAIDframe cleanup, phase 1. Nuke simulator support, user-land driver,oster 1998-11-13RAIDframe, version 1.1, from the Parallel Data Laboratory atoster