static void fuseUnmount(CompDisplay *d) { FUSE_DISPLAY(d); if (fd->watchFdHandle) { compRemoveWatchFd(fd->watchFdHandle); fd->watchFdHandle = 0; } if (fd->mountPoint) { /* unmount will destroy the channel */ fuse_unmount(fd->mountPoint, fd->channel); free(fd->mountPoint); fd->mountPoint = NULL; fd->channel = NULL; } if (fd->buffer) { free(fd->buffer); fd->buffer = NULL; } }
/* This is called when a new ICE connection is made. It arranges for the ICE connection to be handled via the event loop. */ static void iceNewConnection(IceConn connection, IcePointer clientData, Bool opening, IcePointer *watchData) { if (opening) { SM_DEBUG(printf("ICE connection opening\n")); /* Make sure we don't pass on these file descriptors to any exec'ed children */ fcntl(IceConnectionNumber(connection), F_SETFD, fcntl(IceConnectionNumber(connection), F_GETFD, 0) | FD_CLOEXEC); iceWatchFdHandle = compAddWatchFd(IceConnectionNumber(connection), POLLIN | POLLPRI | POLLHUP | POLLERR, iceProcessMessages, connection); iceConnected = 1; } else { SM_DEBUG(printf("ICE connection closing\n")); if (iceConnected) { compRemoveWatchFd(iceWatchFdHandle); iceWatchFdHandle = 0; iceConnected = 0; } } }
static void glibDispatch (CompDisplay *display, GMainContext *context) { int i; GLIB_DISPLAY (display); g_main_context_check (context, gd->maxPriority, gd->fds, gd->nFds); g_main_context_dispatch (context); for (i = 0; i < gd->nFds; i++) compRemoveWatchFd (gd->watch[i].handle); }
static void inotifyFiniDisplay(CompPlugin *p, CompDisplay *d) { INOTIFY_DISPLAY (d); compRemoveWatchFd (id->watchFdHandle); close (id->fd); UNWRAP (id, d, fileWatchAdded); UNWRAP (id, d, fileWatchRemoved); free (id); }