www.nico.schottelius.org/software/cinit/browse_source/cinit-0.0.6/client/begin_msg.c
Nico Schottelius 423ba10303 import cinit from unix.schottelius.org
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
2009-09-16 12:53:45 +02:00

24 lines
405 B
C

/*
* (c) 2005 Nico Schottelius (nico-linux at schottelius.org)
* tell cinit that I want to start a service
* part of cinit
*/
#include <unistd.h>
#include <stdio.h>
#include "cinit.h"
int begin_msg(char cmd)
{
sock = connect_sock(sock);
if( sock == -1 ) {
return 0;
}
if(write(sock,&cmd,sizeof(cmd)) == -1) {
perror("i/o: command");
return 0;
}
return 1;
}