void sh_warnx(const char *fmt, ...) { va_list ap; va_start(ap, fmt); exvwarning(-1, fmt, ap); va_end(ap); }
void sh_errx(int status, const char *fmt, ...) { va_list ap; va_start(ap, fmt); exvwarning(-1, fmt, ap); va_end(ap); sh_exit(status); }
/* * Exverror is called to raise the error exception. If the second argument * is not NULL then error prints an error message using printf style * formatting. It then raises the error exception. */ static void exverror(int cond, const char *msg, va_list ap) { #ifdef DEBUG if (msg) { TRACE(("exverror(%d, \"", cond)); TRACEV((msg, ap)); TRACE(("\") pid=%d\n", getpid())); } else TRACE(("exverror(%d, NULL) pid=%d\n", cond, getpid())); if (msg) #endif exvwarning(-1, msg, ap); flushall(); exraise(cond); /* NOTREACHED */ }
/* * Exverror is called to raise the error exception. If the second argument * is not NULL then error prints an error message using printf style * formatting. It then raises the error exception. */ static __printflike(2, 0) void exverror(int cond, const char *msg, va_list ap) { CLEAR_PENDING_INT; INTOFF; #ifdef DEBUG if (msg) { TRACE(("exverror(%d, \"", cond)); TRACEV((msg, ap)); TRACE(("\") pid=%d\n", getpid())); } else TRACE(("exverror(%d, NULL) pid=%d\n", cond, getpid())); #endif if (msg) exvwarning(-1, msg, ap); flushall(); exraise(cond); /* NOTREACHED */ }
void sh_vwarnx(const char *fmt, va_list ap) { exvwarning(-1, fmt, ap); }
void sh_vwarn(const char *fmt, va_list ap) { exvwarning(errno, fmt, ap); }
void sh_verrx(int status, const char *fmt, va_list ap) { exvwarning(-1, fmt, ap); sh_exit(status); }