Changeset 6dff9d4
- Timestamp:
- 2006-03-01T21:08:03Z (19 years ago)
- Branches:
- master
- Children:
- 8a56e52
- Parents:
- 7cf85e7
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
bitlbee.c
r7cf85e7 r6dff9d4 118 118 if( global.conf->runmode == RUNMODE_FORKDAEMON ) 119 119 ipc_master_load_state(); 120 121 if( global.conf->runmode == RUNMODE_DAEMON || 122 global.conf->runmode == RUNMODE_FORKDAEMON ) 123 ipc_master_listen_socket(); 120 124 121 125 if( ( fp = fopen( global.conf->pidfile, "w" ) ) ) -
configure
r7cf85e7 r6dff9d4 15 15 config='/var/lib/bitlbee/' 16 16 pidfile='/var/run/bitlbee.pid' 17 ipcsocket='/var/run/bitlbee' 17 18 plugindir='$prefix/lib/bitlbee' 18 19 … … 49 50 --pidfile=... $pidfile 50 51 --config=... $config 52 --ipcsocket=... $ipcsocket 51 53 52 54 --msn=0/1 Disable/enable MSN part $msn … … 76 78 config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'` 77 79 plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'` 78 pidfile=`eval echo "$pidfile/" | sed 's/\/\{1,\}/\//g'` 80 pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'` 81 ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'` 79 82 80 83 cat<<EOF>Makefile.settings … … 86 89 DATADIR=$datadir 87 90 PLUGINDIR=$plugindir 88 PIDFILE=$pidfile89 91 CONFIG=$config 92 IPCSOCKET=$ipcsocket 90 93 91 94 ARCH=$arch … … 109 112 #define PLUGINDIR "$plugindir" 110 113 #define PIDFILE "$pidfile" 114 #define IPCSOCKET "$ipcsocket" 111 115 #define ARCH "$arch" 112 116 #define CPU "$cpu" -
ipc.c
r7cf85e7 r6dff9d4 28 28 #include "ipc.h" 29 29 #include "commands.h" 30 #ifndef _WIN32 31 #include <sys/un.h> 32 #endif 30 33 31 34 GSList *child_list = NULL; … … 457 460 } 458 461 462 463 static gboolean new_ipc_client (GIOChannel *gio, GIOCondition cond, gpointer data) 464 { 465 struct bitlbee_child *child = g_new0( struct bitlbee_child, 1 ); 466 int serversock; 467 468 serversock = g_io_channel_unix_get_fd(gio); 469 470 child->ipc_fd = accept(serversock, NULL, 0); 471 472 child->ipc_inpa = gaim_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child ); 473 474 child_list = g_slist_append( child_list, child ); 475 476 return TRUE; 477 } 478 479 #ifndef _WIN32 480 int ipc_master_listen_socket() 481 { 482 struct sockaddr_un un_addr; 483 int serversock; 484 GIOChannel *gio; 485 486 /* Clean up old socket files that were hanging around.. */ 487 unlink(IPCSOCKET); 488 489 un_addr.sun_family = AF_UNIX; 490 strcpy(un_addr.sun_path, IPCSOCKET); 491 492 serversock = socket(AF_UNIX, SOCK_STREAM, PF_UNIX); 493 494 bind(serversock, &un_addr, sizeof(un_addr)); 495 496 listen(serversock, 5); 497 498 gio = g_io_channel_unix_new(serversock); 499 500 g_io_add_watch(gio, G_IO_IN, new_ipc_client, NULL); 501 return 1; 502 } 503 #else 504 /* FIXME: Open named pipe \\.\BITLBEE */ 505 #endif 506 459 507 int ipc_master_load_state() 460 508 { -
ipc.h
r7cf85e7 r6dff9d4 57 57 void ipc_master_set_statefile( char *fn ); 58 58 int ipc_master_load_state(); 59 59 int ipc_master_listen_socket(); 60 60 61 61 extern GSList *child_list;
Note: See TracChangeset
for help on using the changeset viewer.