static int last_printmsg_count = 0;
static const char *tfmt = NULL;
-#if TARGET_OS_EMBEDDED
+#if (TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
static uint32_t dbselect = DB_SELECT_SYSLOGD;
#else
static uint32_t dbselect = DB_SELECT_ASL;
}
}
-#if TARGET_OS_EMBEDDED
+#if (TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
if (store == NULL) store = asl_open_path(ASL_IOS_STATS_DIR, 0);
if (store == NULL)
{
if (kstatus != KERN_SUCCESS)
{
fprintf(stderr, "query failed: can't contact syslogd\n");
+ asl_server_port = MACH_PORT_NULL;
return NULL;
}
}
if (did_match != 0) printmsg(f, msg, pfmt, pflags);
}
-#if TARGET_OS_EMBEDDED
+#if (TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
void
syslogd_direct_watch(FILE *f, char *pfmt, int pflags, asl_msg_list_t *ql)
{
{
if (dbselect == DB_SELECT_SYSLOGD)
{
-#if TARGET_OS_EMBEDDED
+#if (TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
syslogd_direct_watch(outfile, pfmt, pflags, qlist);
#else
fprintf(stderr, "Warning: -w flag cannot be used when querying syslogd directly\n");