History

9gc: exit if no chat found

Sigrid Haflínudóttir committed 6 years ago

Commit 2ca228d1 parent 507bd8e1 file · +5 −7Browse files

Unified · Split

9gc.c+5−7
@@ -25,10 +25,6 @@ enum { · 24 unmodified lines
2525 Joined = 1<<2,
2626 };
2727
28−#define max(a,b) ((a)>(b)?(a):(b))
29−#define used(x) ((void)(x))
30−#define nelem(x) (int)(sizeof(x)/sizeof((x)[0]))
31−
3228 typedef struct C9aux C9aux;
3329 typedef struct REntry REntry;
3430
@@ -243,7 +239,6 @@ ctxregistryR(C9ctx *ctx, C9r *r) · 208 unmodified lines
243239 *s = 0;
244240 if (strstr(b, "tlssrv") == NULL && (s = strchr(b, ' ')) != NULL) {
245241 *s = 0;
246− printf("chat is at %s\n", b);
247242 close(a->f);
248243 if ((a->f = dial(b)) < 0)
249244 exit(1);
@@ -251,11 +246,14 @@ ctxregistryR(C9ctx *ctx, C9r *r) · 1 unmodified line
251246 a->r = ctxchatR;
252247 a->wroff = a->wrend = 0;
253248 c9version(ctx, &tag, Msize);
254− wrsend(a);
255− break;
249+ if (wrsend(a) != 0)
250+ exit(1);
251+ return;
256252 }
257253
258254 }
255+ fprintf(stderr, "chat hasn't been found in the registry\n");
256+ exit(1);
259257 break;
260258
261259 case Rerror:

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