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
25 Joined = 1<<2,25 Joined = 1<<2,
26};26};
27 27
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
32typedef struct C9aux C9aux;28typedef struct C9aux C9aux;
33typedef struct REntry REntry;29typedef struct REntry REntry;
34 30
@@ -243,7 +239,6 @@ ctxregistryR(C9ctx *ctx, C9r *r) · 208 unmodified lines
243 *s = 0;239 *s = 0;
244 if (strstr(b, "tlssrv") == NULL && (s = strchr(b, ' ')) != NULL) {240 if (strstr(b, "tlssrv") == NULL && (s = strchr(b, ' ')) != NULL) {
245 *s = 0;241 *s = 0;
246 printf("chat is at %s\n", b);
247 close(a->f);242 close(a->f);
248 if ((a->f = dial(b)) < 0)243 if ((a->f = dial(b)) < 0)
249 exit(1);244 exit(1);
@@ -251,11 +246,14 @@ ctxregistryR(C9ctx *ctx, C9r *r) · 1 unmodified line
251 a->r = ctxchatR;246 a->r = ctxchatR;
252 a->wroff = a->wrend = 0;247 a->wroff = a->wrend = 0;
253 c9version(ctx, &tag, Msize);248 c9version(ctx, &tag, Msize);
254 wrsend(a);249 if (wrsend(a) != 0)
255 break;250 exit(1);
251 return;
256 }252 }
257 253
258 }254 }
255 fprintf(stderr, "chat hasn't been found in the registry\n");
256 exit(1);
259 break;257 break;
260 258
261 case Rerror:259 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