]> git.saurik.com Git - apple/syslog.git/commitdiff
syslog-69.0.4.tar.gz mac-os-x-1057 mac-os-x-1058 v69.0.4
authorApple <opensource@apple.com>
Fri, 30 Jan 2009 18:43:08 +0000 (18:43 +0000)
committerApple <opensource@apple.com>
Fri, 30 Jan 2009 18:43:08 +0000 (18:43 +0000)
aslmanager.tproj/aslmanager.c

index 38420b558a439ef4aa639f939f3a671b4990c729..f5b8a6f309bbb62f76808e122a0984f230e57978 100644 (file)
@@ -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;