• Home
  • Raw
  • Download

Lines Matching refs:se

120   SocketEntry *se;  in socket_entry_new()  local
123 se = xmalloc (sizeof (SocketEntry)); in socket_entry_new()
126 se->name = xmalloc (len); in socket_entry_new()
128 strcpy (se->name, dir); in socket_entry_new()
129 strcat (se->name, "/"); in socket_entry_new()
130 strcat (se->name, fname); in socket_entry_new()
132 se->fd = -1; in socket_entry_new()
134 se->status = SOCKET_UNKNOWN; in socket_entry_new()
136 se->n_retries = 0; in socket_entry_new()
138 return se; in socket_entry_new()
143 free_socket_entry (SocketEntry *se)
145 free (se->name);
146 if (se->fd >= 0)
147 close (se->fd);
148 free (se);
177 SocketEntry *se; in read_sockets() local
182 se = socket_entry_new (dir, dent->d_name); in read_sockets()
190 entries[n_entries] = se; in read_sockets()
201 open_socket (SocketEntry *se) in open_socket() argument
206 if (se->n_retries > 5) in open_socket()
209 se->name); in open_socket()
213 se->n_retries += 1; in open_socket()
215 se->fd = socket (AF_UNIX, SOCK_STREAM, 0); in open_socket()
216 if (se->fd < 0) in open_socket()
223 if (fcntl (se->fd, F_SETFL, O_NONBLOCK) < 0) in open_socket()
226 se->name, strerror (errno)); in open_socket()
234 strncpy (saddr.sun_path, se->name, sizeof (saddr.sun_path) - 1); in open_socket()
238 ret = connect (se->fd, (struct sockaddr*) &saddr, sizeof (saddr)); in open_socket()
255 se->name, strerror (errno)); in open_socket()
273 SocketEntry *se; in handle_sockets() local
276 se = entries[i]; in handle_sockets()
279 if (se->fd >= 0) in handle_sockets()
282 se->status); in handle_sockets()
286 if (se->status != SOCKET_UNKNOWN) in handle_sockets()
289 status = open_socket (se); in handle_sockets()
295 if (unlink (se->name) < 0) in handle_sockets()
298 se->name, strerror (errno)); in handle_sockets()
300 se->status = SOCKET_FAILED_TO_HANDLE; in handle_sockets()
303 se->status = SOCKET_UNLINKED; in handle_sockets()
312 se->status = status; in handle_sockets()
321 if (se->fd >= 0) in handle_sockets()
323 close (se->fd); in handle_sockets()
324 se->fd = -1; in handle_sockets()
327 if (se->status == SOCKET_UNKNOWN) in handle_sockets()