2 #include <grass/config.h>
12 #include <sys/types.h>
14 #include <grass/gis.h>
22 connpath = G_sock_get_fname(me);
29 if (G_sock_exists(connpath)) {
30 if ((fd = G_sock_connect(connpath)) >= 0) {
32 G_warning(
"Graphics driver [%s] is already running", me);
36 if (unlink(connpath) < 0) {
37 G_warning(
"Failed to remove stale socket file: %s", connpath);
43 if ((fd = G_sock_bind(connpath)) < 0) {
49 if (G_sock_listen(fd, 1) != 0) {
65 FD_SET(listenfd, &waitset);
66 FD_SET(other_fd, &waitset);
67 if (select(FD_SETSIZE, &waitset,
NULL,
NULL,
NULL) < 0) {
68 perror(
"get_connection_sock: select");
72 if (!FD_ISSET(listenfd, &waitset))
78 fd = G_sock_accept(listenfd);
void COM_Graph_close(void)
int get_connection_sock(int, int *, int *, int)
int prepare_connection_sock(const char *)
G_warning("category support for [%s] in mapset [%s] %s", name, mapset, type)
int G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.