All pastes #697089 Raw Edit

Stuff

public text v1 · immutable
#697089 ·published 2007-09-14 06:44 UTC
rendered paste body
#include "include/pi-low.h"

PiLow *pl ;

void handler(int num)
{
        printf("Ctrl+C pressed bailing out\n");
        delete_core_socket(pl->core_socket);
        exit(0);

}


int main(int argv, char **argc)
{

         if(argv < 2 )
        {
                g_error("You have to supply the iface");
        }
        g_debug("Before new_pilow");
        pl = new_pi_low(argc[1], PI_OVER_ETH);
        g_debug("After");
        pi_low_init(pl);
        g_debug("Letting the deamon sleeping");
        signal(SIGTERM, handler);
        signal(SIGSTOP, handler);
        signal(SIGINT, handler);

        while(1) sleep(1);

        return 0;
}