Commit b6fcbc69 authored by Niels Möller's avatar Niels Möller
Browse files

* src/command.c, src/command.h, src/lsh.c, src/lshd.c: Don't allow

a NULL continuation. Instead, use discard_continuation to ignore
the value.

Rev: src/command.c:1.22
Rev: src/command.h:1.30
Rev: src/lsh.c:1.63
Rev: src/lshd.c:1.57
parent f4e9dd9c
......@@ -290,7 +290,7 @@ static int do_parallell_progn(struct command *s,
for (i=0; i < LIST_LENGTH(self->body) - 1; i++)
{
CAST_SUBTYPE(command, command, LIST(self->body)[i]);
res |= COMMAND_CALL(command, x, NULL);
res |= COMMAND_CALL(command, x, &discard_continuation);
if (LSH_CLOSEDP(res))
return res;
}
......
......@@ -47,9 +47,16 @@
/* GABA:
(class
(name command_exception)
(name exception)
(vars
(e method int UINT32)))
(type . UINT32)))
*/
/* GABA:
(class
(name command_raise)
(vars
(e method int "struct exception *")))
*/
/* GABA:
......@@ -58,6 +65,7 @@
(vars
(call method int "struct lsh_object *arg"
"struct command_continuation *c")))
;; "struct command_continuation *e)))
*/
/* GABA:
......@@ -73,10 +81,16 @@
#define COMMAND_CALL(f, a, c) \
((f)->call((f), (struct lsh_object *) (a), (c)))
#if 0
/* NOTE: If R == NULL, don't call the continuation, _but_ the argument
* V must still be evaluated. */
#define COMMAND_RETURN(r, v) \
((r) ? ((r)->c((r), (struct lsh_object *) (v))) : ((void)(v), LSH_OK | LSH_GOON))
#endif
#define COMMAND_RETURN(r, v) ((r)->c((r), (struct lsh_object *) (v)))
#define COMMAND_RAISE(r, v) ((r)->e((r), (v)))
#define COMMAND_SIMPLE(f, a) \
((f)->call_simple((f), (struct lsh_object *)(a)))
......
......@@ -531,7 +531,7 @@ int main(int argc, char **argv)
queue_to_list(&actions));
CAST_SUBTYPE(command, client_connect, o);
int res = COMMAND_CALL(client_connect, remote, NULL);
int res = COMMAND_CALL(client_connect, remote, &discard_continuation);
/* We can free the queue nodes now */
KILL_OBJECT_QUEUE(&actions);
......
......@@ -524,7 +524,7 @@ int main(int argc, char **argv)
CAST_SUBTYPE(command, server_listen, o);
int res = COMMAND_CALL(server_listen, local, NULL);
int res = COMMAND_CALL(server_listen, local, &discard_continuation);
if (res)
{
if (res & LSH_COMMAND_FAILED)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment