All pastes #986289 Raw Edit

Someone

public c v1 · immutable
·published 2008-04-15 17:59 UTC
rendered paste body
#include <errno.h>#include <fcntl.h>#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <sys/stat.h>#define FIFOARG 1#define FIFO_PERMS (S_IRWXU | S_IRWXG | S_IROTH)int main (int argc, char *argv[]) {  setup_pipes(argv[FIFOARG]);}int setup_pipes(char *barriername) {  char pipeone[256];  vsprintf(*pipeone, "%s.request", barriername);  char pipetwo[256];  vsprintf(*pipetwo, "%s.release", barriername);  if ((mkfifo(pipeone, FIFO_PERMS) == -1) && (errno != EEXIST)) {    perror("Server failed to create request FIFO!");    return 1;  }  if ((mkfifo(pipetwo, FIFO_PERMS) == -1) && (errno != EEXIST)) {    perror("Server failed to created release FIFO!");    return 1;  }  return 0;}