25 lines
447 B
C
25 lines
447 B
C
#include "../includes/minitalk.h"
|
|
#include <stdlib.h> //for atoi
|
|
|
|
int usage(void)
|
|
{
|
|
ft_printf("usage: ./client [server pid] [message]\n");
|
|
return (0);
|
|
}
|
|
|
|
void send_message(int server_pid, char *msg)
|
|
{
|
|
if (!ft_strcmp(msg, "SIGUSR1"))
|
|
kill(server_pid, SIGUSR1);
|
|
if (!ft_strcmp(msg, "SIGUSR2"))
|
|
kill(server_pid, SIGUSR2);
|
|
}
|
|
|
|
int main(int ac, char **av)
|
|
{
|
|
if (ac != 3)
|
|
return (usage());
|
|
send_message(ft_atoi(av[1]), av[2]);
|
|
return (0);
|
|
}
|