Changeset 8a56e52
- Timestamp:
- 2006-03-01T22:30:10Z (19 years ago)
- Branches:
- master
- Children:
- 5fe0207
- Parents:
- 6dff9d4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ipc.c
r6dff9d4 r8a56e52 469 469 470 470 child->ipc_fd = accept(serversock, NULL, 0); 471 472 if (child->ipc_fd == -1) { 473 log_message( LOGLVL_WARNING, "Unable to accept connection on UNIX domain socket: %s", strerror(errno) ); 474 return TRUE; 475 } 471 476 472 477 child->ipc_inpa = gaim_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child ); … … 485 490 486 491 /* Clean up old socket files that were hanging around.. */ 487 unlink(IPCSOCKET); 492 if (unlink(IPCSOCKET) == -1 && errno != ENOENT) { 493 log_message( LOGLVL_ERROR, "Could not remove old IPC socket at %s: %s", IPCSOCKET, strerror(errno) ); 494 return 0; 495 } 488 496 489 497 un_addr.sun_family = AF_UNIX; … … 492 500 serversock = socket(AF_UNIX, SOCK_STREAM, PF_UNIX); 493 501 494 bind(serversock, &un_addr, sizeof(un_addr)); 495 496 listen(serversock, 5); 502 if (serversock == -1) { 503 log_message( LOGLVL_WARNING, "Unable to create UNIX socket: %s", strerror(errno) ); 504 return 0; 505 } 506 507 if (bind(serversock, &un_addr, sizeof(un_addr)) == -1) { 508 log_message( LOGLVL_WARNING, "Unable to bind UNIX socket to %s: %s", IPCSOCKET, strerror(errno) ); 509 return 0; 510 } 511 512 if (listen(serversock, 5) == -1) { 513 log_message( LOGLVL_WARNING, "Unable to listen on UNIX socket: %s", strerror(errno) ); 514 return 0; 515 } 497 516 498 517 gio = g_io_channel_unix_new(serversock); 518 519 if (gio == NULL) { 520 log_message( LOGLVL_WARNING, "Unable to create IO channel for unix socket" ); 521 return 0; 522 } 499 523 500 524 g_io_add_watch(gio, G_IO_IN, new_ipc_client, NULL);
Note: See TracChangeset
for help on using the changeset viewer.