make compile and remove warnings
This commit is contained in:
@@ -9,17 +9,17 @@ libheim_ipcs_la_SOURCES = server.c common.c
|
||||
|
||||
include_HEADERS = heim-ipc.h
|
||||
|
||||
libheim_ipsc_la_LDFLAGS = -version-info 0:0:0
|
||||
libheim_ipss_la_LDFLAGS = -version-info 0:0:0
|
||||
libheim_ipcc_la_LDFLAGS = -version-info 0:0:0
|
||||
libheim_ipcs_la_LDFLAGS = -version-info 0:0:0
|
||||
|
||||
libheim_ipsc_la_LIBADD = \
|
||||
libheim_ipcc_la_LIBADD = \
|
||||
$(LIB_roken)
|
||||
|
||||
libheim_ipss_la_LIBADD = $(libheim_ipsc_la_LIBADD)
|
||||
libheim_ipcs_la_LIBADD = $(libheim_ipcc_la_LIBADD)
|
||||
|
||||
if versionscript
|
||||
libheim_ipsc_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-scriptc.map
|
||||
libheim_ipss_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-scripts.map
|
||||
libheim_ipcc_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-scriptc.map
|
||||
libheim_ipcs_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-scripts.map
|
||||
endif
|
||||
|
||||
TESTS = $(check_PROGRAMS)
|
||||
@@ -29,3 +29,31 @@ noinst_PROGRAMS = tc ts
|
||||
ts_LDADD = libheim-ipcs.la
|
||||
tc_LDADD = libheim-ipcc.la
|
||||
|
||||
if LIBDISPATCH
|
||||
|
||||
heim_ipc.h heim_ipcUser.c heim_ipcServer.c heim_ipcServer.h: heim_ipc.defs
|
||||
mig -header heim_ipc.h -user heim_ipcUser.c -sheader heim_ipcServer.h -server heim_ipcServer.c -I$(srcdir) $(srcdir)/heim_ipc.defs
|
||||
|
||||
heim_ipc_async.h heim_ipc_asyncUser.c heim_ipc_asyncServer.c heim_ipc_asyncServer.h: heim_ipc_async.defs
|
||||
mig -header heim_ipc_async.h -user heim_ipc_asyncUser.c -sheader heim_ipc_asyncServer.h -server heim_ipc_asyncServer.c -I$(srcdir) $(srcdir)/heim_ipc_async.defs
|
||||
|
||||
heim_ipc_reply.h heim_ipc_replyUser.c: heim_ipc_reply.defs
|
||||
mig -header heim_ipc_reply.h -user heim_ipc_replyUser.c -sheader /dev/null -server /dev/null -I$(srcdir) $(srcdir)/heim_ipc_reply.defs
|
||||
|
||||
|
||||
built_ipcc = heim_ipc.h heim_ipcUser.c
|
||||
built_ipcc += heim_ipc_asyncServer.c heim_ipc_asyncServer.h
|
||||
|
||||
libheim_ipcc_la_SOURCES += $(built_ipcc)
|
||||
|
||||
built_ipcs = heim_ipcServer.c heim_ipcServer.h
|
||||
built_ipcs += heim_ipc_asyncUser.c heim_ipc_async.h
|
||||
built_ipcs += heim_ipc_reply.h heim_ipc_replyUser.c
|
||||
|
||||
libheim_ipcs_la_SOURCES += $(built_ipcs)
|
||||
|
||||
libheim_ipcs_la_LIBADD += -lbsm
|
||||
|
||||
CLEANFILES = $(built_ipcc) $(built_ipcs)
|
||||
|
||||
endif
|
@@ -347,10 +347,6 @@ common_path_init(const char *service,
|
||||
void **ctx)
|
||||
{
|
||||
struct path_ctx *s;
|
||||
const char *path;
|
||||
char *apath = NULL;
|
||||
int ret;
|
||||
int *fd;
|
||||
|
||||
s = malloc(sizeof(*s));
|
||||
if (s == NULL)
|
||||
|
@@ -35,6 +35,8 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define HAVE_LIBDISPATCH 1
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/un.h>
|
||||
|
||||
@@ -48,6 +50,22 @@
|
||||
|
||||
#include <heim-ipc.h>
|
||||
|
||||
#if defined(__APPLE__) && defined(HAVE_LIBDISPATCH)
|
||||
#include <mach/mach.h>
|
||||
#include <servers/bootstrap.h>
|
||||
#include <dispatch/dispatch.h>
|
||||
#include <bsm/libbsm.h>
|
||||
|
||||
#ifndef __APPLE_PRIVATE__ /* awe, using private interface */
|
||||
typedef boolean_t (*dispatch_mig_callback_t)(mach_msg_header_t *message, mach_msg_header_t *reply);
|
||||
|
||||
mach_msg_return_t
|
||||
dispatch_mig_server(dispatch_source_t ds, size_t maxmsgsz, dispatch_mig_callback_t callback);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include <roken.h>
|
||||
|
||||
int
|
||||
|
@@ -44,11 +44,9 @@ struct heim_sipc {
|
||||
|
||||
#if defined(__APPLE__) && defined(HAVE_LIBDISPATCH)
|
||||
|
||||
#include <mach/mach.h>
|
||||
#include <dispatch/dispatch.h>
|
||||
#include <bsm/libbsm.h>
|
||||
#include "heim_ipcServer.h"
|
||||
#include "heim_ipc_reply.h"
|
||||
#include "heim_ipc_async.h"
|
||||
|
||||
static dispatch_source_t timer;
|
||||
static dispatch_queue_t timerq;
|
||||
@@ -201,10 +199,8 @@ mheim_do_call(mach_port_t server_port,
|
||||
mach_msg_type_number_t *replyoutCnt)
|
||||
{
|
||||
heim_sipc ctx = dispatch_get_context(dispatch_get_current_queue());
|
||||
struct mach_service *st = ctx->mech;
|
||||
struct mach_call_ctx *s;
|
||||
kern_return_t kr;
|
||||
heim_icred cred;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
pid_t pid;
|
||||
@@ -258,10 +254,8 @@ mheim_do_call_request(mach_port_t server_port,
|
||||
mach_msg_type_number_t requestoutCnt)
|
||||
{
|
||||
heim_sipc ctx = dispatch_get_context(dispatch_get_current_queue());
|
||||
struct mach_service *st = ctx->mech;
|
||||
struct mach_call_ctx *s;
|
||||
kern_return_t kr;
|
||||
heim_icred cred;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
pid_t pid;
|
||||
@@ -301,13 +295,10 @@ mheim_do_call_request(mach_port_t server_port,
|
||||
return KERN_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int
|
||||
mach_init(const char *service, mach_port_t sport, heim_sipc ctx)
|
||||
{
|
||||
struct mach_service *s;
|
||||
kern_return_t kr;
|
||||
char *name;
|
||||
|
||||
init_globals();
|
||||
@@ -373,6 +364,7 @@ mach_checkin_or_register(const char *service)
|
||||
if (kr == KERN_SUCCESS)
|
||||
return mp;
|
||||
|
||||
/* Pre SnowLeopard version */
|
||||
kr = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &mp);
|
||||
if (kr != KERN_SUCCESS)
|
||||
return MACH_PORT_NULL;
|
||||
@@ -384,7 +376,7 @@ mach_checkin_or_register(const char *service)
|
||||
return MACH_PORT_NULL;
|
||||
}
|
||||
|
||||
kr = bootstrap_register(bootstrap_port, service, mp);
|
||||
kr = bootstrap_register(bootstrap_port, rk_UNCONST(service), mp);
|
||||
if (kr != KERN_SUCCESS) {
|
||||
mach_port_destroy(mach_task_self(), mp);
|
||||
return MACH_PORT_NULL;
|
||||
@@ -404,7 +396,7 @@ heim_sipc_launchd_mach_init(const char *service,
|
||||
{
|
||||
#if defined(__APPLE__) && defined(HAVE_LIBDISPATCH)
|
||||
mach_port_t sport = MACH_PORT_NULL;
|
||||
heim_sipc c;
|
||||
heim_sipc c = NULL;
|
||||
int ret;
|
||||
|
||||
*ctx = NULL;
|
||||
|
Reference in New Issue
Block a user