~andreserl/ubuntu/lucid/bind9/bind9-apport-533601

« back to all changes in this revision

Viewing changes to lib/dns/journal.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2006-01-05 12:29:28 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060105122928-oih7ttkkmpb90q8q
Tags: 1:9.3.2-1
* New upstream
* use lsb-base for start/stop messages in init.d.
* switch to debhelper 4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
 
2
 * Copyright (C) 2004, 2005  Internet Systems Consortium, Inc. ("ISC")
3
3
 * Copyright (C) 1999-2002  Internet Software Consortium.
4
4
 *
5
5
 * Permission to use, copy, modify, and distribute this software for any
15
15
 * PERFORMANCE OF THIS SOFTWARE.
16
16
 */
17
17
 
18
 
/* $Id: journal.c,v 1.77.2.1.10.9 2004/09/16 04:57:02 marka Exp $ */
 
18
/* $Id: journal.c,v 1.77.2.1.10.13 2005/11/03 23:08:41 marka Exp $ */
19
19
 
20
20
#include <config.h>
21
21
 
22
22
#include <stdlib.h>
 
23
#include <unistd.h>
23
24
 
24
25
#include <isc/file.h>
25
26
#include <isc/mem.h>
1564
1565
        /*
1565
1566
         * Read an RR.
1566
1567
         */
1567
 
        result = journal_read_rrhdr(j, &rrhdr);
 
1568
        CHECK(journal_read_rrhdr(j, &rrhdr));
1568
1569
        /*
1569
1570
         * Perform a sanity check on the journal RR size.
1570
1571
         * The smallest possible RR has a 1-byte owner name
1750
1751
        isc_result_t result;
1751
1752
        dns_difftuple_t *p[2];
1752
1753
        int i, t;
 
1754
        isc_boolean_t append;
 
1755
 
1753
1756
        CHECK(dns_diff_sort(&diff[0], rdata_order));
1754
1757
        CHECK(dns_diff_sort(&diff[1], rdata_order));
1755
1758
 
1778
1781
                }
1779
1782
                INSIST(t == 0);
1780
1783
                /*
1781
 
                 * Identical RRs in both databases; skip them both.
 
1784
                 * Identical RRs in both databases; skip them both
 
1785
                 * if the ttl differs.
1782
1786
                 */
 
1787
                append = ISC_TF(p[0]->ttl != p[1]->ttl);
1783
1788
                for (i = 0; i < 2; i++) {
1784
1789
                        ISC_LIST_UNLINK(diff[i].tuples, p[i], link);
1785
 
                        dns_difftuple_free(&p[i]);
 
1790
                        if (append) {
 
1791
                                ISC_LIST_APPEND(r->tuples, p[i], link);
 
1792
                        } else {
 
1793
                                dns_difftuple_free(&p[i]);
 
1794
                        }
1786
1795
                }
1787
1796
        next: ;
1788
1797
        }