shithub: drawcpu

ref: 1e72ca9a502a78a97523c2b79aa558e16ed4d8bd
dir: /session.c/

View raw version
#include <u.h>
#include <libc.h>
#include <rc.h>

// TODO: aanserver
static void
sessionexit(void)
{
    char *s = getenv("rstatus");
    if(s != nil)
        exit(*s);
}

int
session(int fd)
{
    char buf[1024];
    read(fd, buf, sizeof buf);
    char *cmd[] = {
        "rc",
        "-c",
        buf
    };

    runscript(fd, 1, cmd);
    return -1;
}