/* * This function is used to accept a connnection from a client. */ void GsAcceptClient(void) { int i; #if !HELLOOS #if ELKS struct sockaddr_na sckt; #elif __ECOS struct sockaddr_in sckt; #else struct sockaddr_un sckt; #endif socklen_t size = sizeof(sckt); if((i = accept(un_sock, (struct sockaddr *) &sckt, &size)) == -1) { EPRINTF("nano-X: Error accept failed (%d)\n", errno); return; } #else /*!HELLOS*/ if((i = bucket_accept(un_sock)) < 0) { EPRINTF("nano-X: Error accept failed (%d)\n", i); return; } #endif /*!HELLOS*/ GsAcceptClientFd(i); }
/* * Open a connection from a new client to the server. * Returns -1 on failure. */ int GrOpen(void) { #if NONETWORK SERVER_LOCK(); escape_quits = 1; /* Client calls this routine once. We * init everything here */ if (connectcount <= 0) { if(GsInitialize() < 0) { SERVER_UNLOCK(); return -1; } } if (! GsAcceptClientFd(999)) { SERVER_UNLOCK(); return -1; } curclient = root_client; SERVER_UNLOCK(); #endif return 1; }
/* * Open a connection from a new client to the server. * Returns -1 on failure. */ int GrOpen(void) { GdPlatformInit(); /* platform-specific initialization*/ #if NONETWORK SERVER_LOCK(); /* Client calls this routine once. We init everything here*/ if (connectcount <= 0) { if(GsInitialize() < 0) { SERVER_UNLOCK(); return -1; } GsAcceptClientFd(999); curclient = root_client; } SERVER_UNLOCK(); #endif /* NONETWORK*/ #if NANOWM wm_init(); /* init built-in window manager*/ #endif return 1; }
/* * Open a connection from a new client to the server. * Returns -1 on failure. */ int GsOpen(void) { #if NONETWORK /* Client calls this routine once. We * init everything here */ if(GsInitialize() < 0) return -1; GsAcceptClientFd(999); curclient = root_client; #endif return 1; }
/* * This function is used to accept a connnection from a client. */ void GsAcceptClient(void) { int i; #if ELKS struct sockaddr_na sckt; #elif __ECOS struct sockaddr_in sckt; #else struct sockaddr_un sckt; #endif size_t size = sizeof(sckt); if((i = accept(un_sock, (struct sockaddr *) &sckt, &size)) == -1) { #ifdef __ECOS // All ports should do this EPRINTF("nano-X: Error accept failed (%s)\n", strerror(errno)); #else EPRINTF("nano-X: Error accept failed (%d)\n", errno); #endif return; } GsAcceptClientFd(i); }