Changeset 2673 for neercs/trunk
- Timestamp:
- Aug 5, 2008, 2:19:39 PM (13 years ago)
- Location:
- neercs/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
neercs/trunk/src/main.c
r2645 r2673 194 194 if(!screen_list->attach) 195 195 { 196 if(start_server(screen_list ->to_grab, screen_list->to_start, screen_list))196 if(start_server(screen_list)) 197 197 goto end; 198 198 } -
neercs/trunk/src/neercs.h
r2642 r2673 237 237 char * connect_socket(struct screen_list* screen_list, enum socket_type socktype); 238 238 char ** list_sockets(char *socket_dir, char *session_name); 239 int start_server( int *to_grab, char **to_start,struct screen_list *screen_list);239 int start_server(struct screen_list *screen_list); 240 240 int send_event(caca_event_t ev, struct screen_list* screen_list); 241 241 -
neercs/trunk/src/server.c
r2646 r2673 108 108 } 109 109 110 static int server_main( int *to_grab, char **to_start,struct screen_list *screen_list)110 static int server_main(struct screen_list *screen_list) 111 111 { 112 112 int i; … … 131 131 + screen_list->status); 132 132 133 if(! to_grab && !to_start)133 if(!screen_list->to_grab && !screen_list->to_start) 134 134 { 135 135 add_screen(screen_list, … … 140 140 141 141 /* Attach processes */ 142 if( to_grab)143 { 144 for(i=0; to_grab[i]; i++)142 if(screen_list->to_grab) 143 { 144 for(i=0; screen_list->to_grab[i]; i++) 145 145 { 146 146 add_screen(screen_list, 147 147 create_screen_grab(screen_list->width, 148 148 screen_list->height, 149 to_grab[i])); 150 } 151 free(to_grab); 149 screen_list->to_grab[i])); 150 } 151 free(screen_list->to_grab); 152 screen_list->to_grab = NULL; 152 153 } 153 154 154 155 /* Launch command line processes */ 155 if( to_start)156 { 157 for(i=0; to_start[i]; i++)156 if(screen_list->to_start) 157 { 158 for(i=0; screen_list->to_start[i]; i++) 158 159 { 159 160 add_screen(screen_list, 160 161 create_screen(screen_list->width, 161 162 screen_list->height, 162 to_start[i])); 163 } 164 free(to_start); 163 screen_list->to_start[i])); 164 free(screen_list->to_start[i]); 165 } 166 free(screen_list->to_start); 167 screen_list->to_start = NULL; 165 168 } 166 169 … … 401 404 } 402 405 403 int start_server( int *to_grab, char **to_start,struct screen_list *screen_list)406 int start_server(struct screen_list *screen_list) 404 407 { 405 408 pid_t pid; … … 435 438 #endif 436 439 setsid(); 437 return server_main( to_grab, to_start,screen_list);440 return server_main(screen_list); 438 441 } 439 442 create_socket(screen_list, SOCK_CLIENT);
Note: See TracChangeset
for help on using the changeset viewer.