return -1;
}
-#if !TARGET_IPHONE_SIMULATOR
+#if !TARGET_OS_SIMULATOR
if (chown(dstpath, r->dst->uid[0], r->dst->gid[0]) != 0)
{
asldebug("_asl_dir_storedata_open: chown %d %d new %s: %s\n", dstpath, r->dst->uid[0], r->dst->gid[0], strerror(errno));
_act_checkpoint(asl_out_rule_t *r, uint32_t force)
{
char tmpcurrent_name[MAXPATHLEN], *fn;
+ bool size_only = false;
if (r == NULL) return 0;
if (r->dst == NULL) return 0;
fn = tmpcurrent_name;
}
- if ((force == CHECKPOINT_TEST) && (r->dst->file_max == 0)) return 0;
+ if ((force == CHECKPOINT_TEST) || (r->dst->flags & MODULE_FLAG_SIZE_ONLY))
+ {
+ size_only = true;
+ }
+
+ if (size_only && (r->dst->file_max == 0)) return 0;
if ((r->dst->size == 0) || (r->dst->timestamp == 0))
{
r->dst->size = sb.st_size;
}
- if ((force == CHECKPOINT_TEST) && (r->dst->size < r->dst->file_max)) return 0;
+ if (size_only && (r->dst->size < r->dst->file_max)) return 0;
if (r->dst->flags & MODULE_FLAG_BASESTAMP)
{
return -1;
}
-#if TARGET_IPHONE_SIMULATOR
+#if TARGET_OS_SIMULATOR
uid_t uid = -1;
gid_t gid = -1;
#else
if (m == NULL) return 0;
-
for (r = m->ruleset; r != NULL; r = r->next)
{
if ((r->action == ACTION_FILE) || (r->action == ACTION_ASL_FILE))
{
if (_act_file_equal(r->dst->path, path))
{
- if (force & CHECKPOINT_CRASH)
+ if (_act_checkpoint(r, force) > 0)
{
- if (r->dst->flags & MODULE_FLAG_CRASHLOG)
- {
- if (_act_checkpoint(r, CHECKPOINT_FORCE) > 0)
- {
- did_checkpoint = 1;
- _act_dst_close(r, DST_CLOSE_CHECKPOINT);
- }
- }
- }
- else
- {
- if (_act_checkpoint(r, force) > 0)
- {
- did_checkpoint = 1;
- _act_dst_close(r, DST_CLOSE_CHECKPOINT);
- }
+ did_checkpoint = 1;
+ _act_dst_close(r, DST_CLOSE_CHECKPOINT);
}
}
}
if (p != NULL) asl_msg_set_key_val(msg, ASL_KEY_FREE_NOTE, p);
/* chain to the next output module (done this way to make queue size accounting easier */
-#if !TARGET_IPHONE_SIMULATOR
+#if !TARGET_OS_SIMULATOR
if (global.bsd_out_enabled) bsd_out_message(msg, msize);
else OSAtomicAdd64(-1ll * msize, &global.memory_size);
#else
return 0;
}
-int
-asl_action_file_checkpoint(const char *module, const char *path)
-{
- /* Note this is synchronous on asl_action queue */
- dispatch_sync(asl_action_queue, ^{
- asl_out_module_t *m = _asl_action_module_with_name(module);
- _act_file_checkpoint(m, path, CHECKPOINT_FORCE);
- });
-
- return 0;
-}
-
void
asl_action_out_module_query(asl_msg_t *q, asl_msg_t *m, bool all)
{