Ignore:
Timestamp:
Jun 25, 2011, 12:08:51 PM (9 years ago)
Author:
Sam Hocevar
Message:

mini: tweak stuff in the mini server / mini client test programs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/mini-server.c

    r4381 r4783  
    11/*
    22 *  neercs        console-based window manager
    3  *  Copyright (c) 2006-2010 Sam Hocevar <sam@hocevar.net>
     3 *  Copyright (c) 2006-2011 Sam Hocevar <sam@hocevar.net>
    44 *                2008-2010 Jean-Yves Lamoureux <jylam@lnxscene.org>
    55 *                2008-2010 Pascal Terjan <pterjan@linuxfr.org>
     
    2727void server_init(void)
    2828{
     29while (!insock)
    2930    insock = socket_open("/tmp/neercs.sock", 1);
    3031}
     
    3536    ssize_t bytes;
    3637    int ret;
     38
     39    if (outsock)
     40    {
     41        ret = socket_select(outsock, 1000);
     42        if (ret <= 0)
     43            goto nothing;
     44
     45        bytes = socket_read(outsock, buf, BUFSIZ);
     46        if (bytes <= 0)
     47            goto nothing;
     48    }
     49nothing:
    3750
    3851    ret = socket_select(insock, 1000);
Note: See TracChangeset for help on using the changeset viewer.