Lines Matching defs:fifos

1200 /* Initialize a fifos structure with path names. */
1201 static void _init_fifos(struct dm_event_fifos *fifos)
1203 memset(fifos, 0, sizeof(*fifos));
1205 fifos->client_path = DM_EVENT_FIFO_CLIENT;
1206 fifos->server_path = DM_EVENT_FIFO_SERVER;
1209 /* Open fifos used for client communication. */
1210 static int _open_fifos(struct dm_event_fifos *fifos)
1212 /* Create fifos */
1213 if (((mkfifo(fifos->client_path, 0600) == -1) && errno != EEXIST) ||
1214 ((mkfifo(fifos->server_path, 0600) == -1) && errno != EEXIST)) {
1223 if ((!stat(fifos->client_path, &st)) && (st.st_mode & 0777) != 0600)
1225 fifos->client_path);
1227 if ((!stat(fifos->server_path, &st)) && (st.st_mode & 0777) != 0600)
1229 fifos->server_path);
1232 if (chmod(fifos->client_path, 0600)) {
1234 fifos->client_path);
1238 if (chmod(fifos->server_path, 0600)) {
1240 fifos->server_path);
1245 if ((fifos->server = open(fifos->server_path, O_RDWR)) < 0) {
1251 if ((fifos->client = open(fifos->client_path, O_RDWR)) < 0) {
1253 close(fifos->server);
1264 static int _client_read(struct dm_event_fifos *fifos,
1281 FD_SET(fifos->client, &fds);
1284 ret = select(fifos->client + 1, &fds, NULL, NULL, &t);
1295 ret = read(fifos->client, buf + bytes, size - bytes);
1320 static int _client_write(struct dm_event_fifos *fifos,
1340 FD_SET(fifos->server, &fds);
1341 } while (select(fifos->server + 1, NULL, &fds, NULL, NULL) !=
1344 ret = write(fifos->server, buf + bytes, size - bytes);
1417 static void _process_request(struct dm_event_fifos *fifos)
1427 if (!_client_read(fifos, &msg))
1434 if (!_client_write(fifos, &msg))
1678 struct dm_event_fifos fifos;
1726 _init_fifos(&fifos);
1735 if ((ret = _open_fifos(&fifos)))
1743 _process_request(&fifos);