History

Less or better chatter.

Russ Cox committed 21 years ago

Commit d920d421 parent 74d480c2 files · +16 −32Browse files

Unified · Split

2 files
  1. exportfs/exportfs.c +16 −5
  2. kern/devcons.c +0 −27
exportfs/exportfs.c+16−5
@@ -28,7 +28,7 @@ exportfs(int fd, int msgsz) · 27 unmodified lines
28{28{
29 char buf[ERRMAX], ebuf[ERRMAX];29 char buf[ERRMAX], ebuf[ERRMAX];
30 Fsrpc *r;30 Fsrpc *r;
31 int n;31 int i, n;
32 char *dbfile, *srv, *file;32 char *dbfile, *srv, *file;
33 ulong initial;33 ulong initial;
34 34
@@ -85,11 +85,21 @@ exportfs(int fd, int msgsz) · 50 unmodified lines
85 DEBUG(DFD, "read9p...");85 DEBUG(DFD, "read9p...");
86 n = read9pmsg(netfd, r->buf, messagesize);86 n = read9pmsg(netfd, r->buf, messagesize);
87 if(n <= 0)87 if(n <= 0)
88 fatal(nil);88 fatal("eof: n=%d %r", n);
89 89
90 if(convM2S(r->buf, n, &r->work) == 0)90 if(convM2S(r->buf, n, &r->work) == 0){
91 iprint("convM2S %d byte message\n", n);
92 for(i=0; i<n; i++){
93 iprint(" %.2ux", r->buf[i]);
94 if(i%16 == 15)
95 iprint("\n");
96 }
97 if(i%16)
98 iprint("\n");
91 fatal("convM2S format error");99 fatal("convM2S format error");
100 }
92 101
102//iprint("<- %F\n", &r->work);
93 DEBUG(DFD, "%F\n", &r->work);103 DEBUG(DFD, "%F\n", &r->work);
94 (fcalls[r->work.type])(r);104 (fcalls[r->work.type])(r);
95 }105 }
@@ -110,6 +120,7 @@ reply(Fcall *r, Fcall *t, char *err) · 14 unmodified lines
110 else 120 else
111 t->type = r->type + 1;121 t->type = r->type + 1;
112 122
123//iprint("-> %F\n", t);
113 DEBUG(DFD, "\t%F\n", t);124 DEBUG(DFD, "\t%F\n", t);
114 125
115 data = malloc(messagesize); /* not mallocz; no need to clear */126 data = malloc(messagesize); /* not mallocz; no need to clear */
@@ -117,7 +128,7 @@ reply(Fcall *r, Fcall *t, char *err) · 1 unmodified line
117 fatal(Enomem);128 fatal(Enomem);
118 n = convS2M(t, data, messagesize);129 n = convS2M(t, data, messagesize);
119 if((m=write(netfd, data, n))!=n){130 if((m=write(netfd, data, n))!=n){
120 fprint(2, "wrote %d got %d (%r)\n", n, m);131 iprint("wrote %d got %d (%r)\n", n, m);
121 fatal("write");132 fatal("write");
122 }133 }
123 free(data);134 free(data);
kern/devcons.c+0−27
@@ -147,33 +147,6 @@ putstrn0(char *str, int n, int usewrite) · 146 unmodified lines
147 qiwrite(kprintoq, str, n);147 qiwrite(kprintoq, str, n);
148 }else if(screenputs != nil)148 }else if(screenputs != nil)
149 screenputs(str, n);149 screenputs(str, n);
150
151 if(serialoq == nil){
152 uartputs(str, n);
153 return;
154 }
155
156 while(n > 0) {
157 t = memchr(str, '\n', n);
158 if(t && !kbd.raw) {
159 m = t-str;
160 if(usewrite){
161 qwrite(serialoq, str, m);
162 qwrite(serialoq, "\r\n", 2);
163 } else {
164 qiwrite(serialoq, str, m);
165 qiwrite(serialoq, "\r\n", 2);
166 }
167 n -= m+1;
168 str = t+1;
169 } else {
170 if(usewrite)
171 qwrite(serialoq, str, n);
172 else
173 qiwrite(serialoq, str, n);
174 break;
175 }
176 }
177}150}
178 151
179void152void

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t