From: Apple Date: Fri, 30 Jan 2009 18:43:08 +0000 (+0000) Subject: syslog-69.0.4.tar.gz X-Git-Tag: mac-os-x-1057^0 X-Git-Url: https://git.saurik.com/apple/syslog.git/commitdiff_plain/94194072b557c3881168a08e1d58367a3e3c8b4d?hp=57b0aad2c678a02fcc3e8b5756d4a13d9061babf syslog-69.0.4.tar.gz --- diff --git a/aslmanager.tproj/aslmanager.c b/aslmanager.tproj/aslmanager.c index 38420b5..f5b8a6f 100644 --- a/aslmanager.tproj/aslmanager.c +++ b/aslmanager.tproj/aslmanager.c @@ -41,6 +41,8 @@ #define DEFAULT_MAX_SIZE 51200000 #define DEFAULT_TTL 2 +#define LONGTTL_TMP_FILE "LongTTL.new" + typedef struct name_list_s { char *name; @@ -405,7 +407,8 @@ main(int argc, const char *argv[]) while ((dent = readdir(dp)) != NULL) { - if (!strncmp(dent->d_name, "LongTTL.", 8)) list = add_to_list(list, dent->d_name, 0); + if (!strcmp(dent->d_name, LONGTTL_TMP_FILE)) unlink(LONGTTL_TMP_FILE); + else if (!strncmp(dent->d_name, "LongTTL.", 8)) list = add_to_list(list, dent->d_name, 0); } closedir(dp); @@ -428,9 +431,9 @@ main(int argc, const char *argv[]) } else { - status = do_match(e->name, "LongTTL.new", 1, now); + status = do_match(e->name, LONGTTL_TMP_FILE, 1, now); unlink(e->name); - if (status == ASL_STATUS_OK) rename("LongTTL.new", e->name); + if (status == ASL_STATUS_OK) rename(LONGTTL_TMP_FILE, e->name); } e = e->next;