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
2828 {
2929 char buf[ERRMAX], ebuf[ERRMAX];
3030 Fsrpc *r;
31− int n;
31+ int i, n;
3232 char *dbfile, *srv, *file;
3333 ulong initial;
3434
@@ -85,11 +85,21 @@ exportfs(int fd, int msgsz) · 50 unmodified lines
8585 DEBUG(DFD, "read9p...");
8686 n = read9pmsg(netfd, r->buf, messagesize);
8787 if(n <= 0)
88− fatal(nil);
89−
90− if(convM2S(r->buf, n, &r->work) == 0)
88+ fatal("eof: n=%d %r", n);
89+
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");
9199 fatal("convM2S format error");
100+ }
92101
102+//iprint("<- %F\n", &r->work);
93103 DEBUG(DFD, "%F\n", &r->work);
94104 (fcalls[r->work.type])(r);
95105 }
@@ -110,6 +120,7 @@ reply(Fcall *r, Fcall *t, char *err) · 14 unmodified lines
110120 else
111121 t->type = r->type + 1;
112122
123+//iprint("-> %F\n", t);
113124 DEBUG(DFD, "\t%F\n", t);
114125
115126 data = malloc(messagesize); /* not mallocz; no need to clear */
@@ -117,7 +128,7 @@ reply(Fcall *r, Fcall *t, char *err) · 1 unmodified line
117128 fatal(Enomem);
118129 n = convS2M(t, data, messagesize);
119130 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);
121132 fatal("write");
122133 }
123134 free(data);
kern/devcons.c+0−27
@@ -147,33 +147,6 @@ putstrn0(char *str, int n, int usewrite) · 146 unmodified lines
147147 qiwrite(kprintoq, str, n);
148148 }else if(screenputs != nil)
149149 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− }
177150 }
178151
179152 void

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