add USL's copyright notice
[unix-history] / usr / src / sys / kern / subr_prf.c
index 6f20f9c..3b2462e 100644 (file)
@@ -1,10 +1,15 @@
 /*-
 /*-
- * Copyright (c) 1986, 1988, 1991 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1986, 1988, 1991, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)subr_prf.c  7.36 (Berkeley) %G%
+ *     @(#)subr_prf.c  8.3 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -29,7 +34,7 @@
 #include <machine/stdarg.h>
 
 #ifdef KADB
 #include <machine/stdarg.h>
 
 #ifdef KADB
-#include "machine/kdbparam.h"
+#include <machine/kdbparam.h>
 #endif
 
 #define TOCONS 0x01
 #endif
 
 #define TOCONS 0x01
@@ -126,7 +131,7 @@ uprintf(fmt, va_alist)
        register struct proc *p = curproc;
        va_list ap;
 
        register struct proc *p = curproc;
        va_list ap;
 
-       if (p->p_flag & SCTTY && p->p_session->s_ttyvp) {
+       if (p->p_flag & P_CONTROLT && p->p_session->s_ttyvp) {
                va_start(ap, fmt);
                kprintf(fmt, TOTTY, p->p_session->s_ttyp, ap);
                va_end(ap);
                va_start(ap, fmt);
                kprintf(fmt, TOTTY, p->p_session->s_ttyp, ap);
                va_end(ap);
@@ -138,7 +143,7 @@ tprintf_open(p)
        register struct proc *p;
 {
 
        register struct proc *p;
 {
 
-       if (p->p_flag & SCTTY && p->p_session->s_ttyvp) {
+       if (p->p_flag & P_CONTROLT && p->p_session->s_ttyvp) {
                SESSHOLD(p->p_session);
                return ((tpr_t) p->p_session);
        }
                SESSHOLD(p->p_session);
                return ((tpr_t) p->p_session);
        }
@@ -338,7 +343,7 @@ kprintf(fmt, flags, tp, ap)
        struct tty *tp;
        va_list ap;
 {
        struct tty *tp;
        va_list ap;
 {
-       register char *p;
+       register char *p, *q;
        register int ch, n;
        u_long ul;
        int base, lflag, tmp, width;
        register int ch, n;
        u_long ul;
        int base, lflag, tmp, width;
@@ -372,7 +377,7 @@ reswitch:   switch (ch = *(u_char *)fmt++) {
                case 'b':
                        ul = va_arg(ap, int);
                        p = va_arg(ap, char *);
                case 'b':
                        ul = va_arg(ap, int);
                        p = va_arg(ap, char *);
-                       for (p = ksprintn(ul, *p++, NULL); ch = *p--;)
+                       for (q = ksprintn(ul, *p++, NULL); ch = *q--;)
                                putchar(ch, flags, tp);
 
                        if (!ul)
                                putchar(ch, flags, tp);
 
                        if (!ul)
@@ -385,7 +390,8 @@ reswitch:   switch (ch = *(u_char *)fmt++) {
                                                putchar(n, flags, tp);
                                        tmp = 1;
                                } else
                                                putchar(n, flags, tp);
                                        tmp = 1;
                                } else
-                                       for (; *p > ' '; ++p);
+                                       for (; *p > ' '; ++p)
+                                               continue;
                        }
                        if (tmp)
                                putchar('>', flags, tp);
                        }
                        if (tmp)
                                putchar('>', flags, tp);