static int makeDownloadFifo (void) { #ifdef __MINGW32__ return 0; #else /* __MINGW32__ */ return makeFifo(downloadPath, S_IRUSR|S_IWUSR|S_IWGRP|S_IWOTH); #endif /* __MINGW32__ */ }
int startServer(char *val) { int s_present = 0; initFiles(); initClient(); if (!strncmp(val, "-server", 7)) s_present = 1; if (!makeFifo()) { printf("[0;32m Could not create Fifo's[m"); fflush(stdout); return QUIT; } execShellServ(val); if (s_present) return 0; return waitOutput(); }
int startServer(char *val) { int ret; initFiles(); initClient(); if (!makeFifo()) { printf("[0;32m Could not create Fifo's[m"); fflush(stdout); return QUIT; } execShellServ(val); ret = waitOutput(); return ret; }
/* Creates fifo for every child , called with child's pid number * * @param pids : array of children processes pids */ void createChildrenFifo_w(pid_t *pids) { int i; /* initialization of buffer for path of FIFO to create */ char *file_name = malloc(30 * sizeof(char)); if (file_name == NULL) { perror("malloc error"); exit(EXIT_FAILURE); } /* create a writing FIFO for each child */ for(i = 0; i< CHILDREN_NUM; i++){ sprintf(file_name, "/tmp/%ldw", (long)pids[i]); if(!fileExist(file_name)){ makeFifo(file_name); printf("created fifo %s\n", file_name); } } }