~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/dist/template/rec_ctemp

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * PREF_FUNC_recover --
3
 
 *      Recovery function for FUNC.
4
 
 *
5
 
 * PUBLIC: int PREF_FUNC_recover
6
 
 * PUBLIC:   __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
7
 
 */
8
 
int
9
 
PREF_FUNC_recover(dbenv, dbtp, lsnp, op, info)
10
 
        DB_ENV *dbenv;
11
 
        DBT *dbtp;
12
 
        DB_LSN *lsnp;
13
 
        db_recops op;
14
 
        void *info;
15
 
{
16
 
        PREF_FUNC_args *argp;
17
 
        DB *file_dbp;
18
 
        DBC *dbc;
19
 
        DB_MPOOLFILE *mpf;
20
 
        PAGE *pagep;
21
 
        int cmp_n, cmp_p, modified, ret;
22
 
 
23
 
        REC_PRINT(PREF_FUNC_print);
24
 
        REC_INTRO(PREF_FUNC_read, 1);
25
 
 
26
 
        if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0)
27
 
                if (DB_REDO(op)) {
28
 
                        if ((ret = mpf->get(mpf,
29
 
                            &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
30
 
                                goto out;
31
 
                } else {
32
 
                        *lsnp = argp->prev_lsn;
33
 
                        ret = 0;
34
 
                        goto out;
35
 
                }
36
 
 
37
 
        modified = 0;
38
 
        cmp_n = log_compare(lsnp, &LSN(pagep));
39
 
 
40
 
        /*
41
 
         * Use this when there is something like "pagelsn" in the argp
42
 
         * structure.  Sometimes, you might need to compare meta-data
43
 
         * lsn's instead.
44
 
         *
45
 
         * cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
46
 
         */
47
 
        if (cmp_p == 0 && DB_REDO(op)) {
48
 
                /* Need to redo update described. */
49
 
                modified = 1;
50
 
        } else if (cmp_n == 0 && !DB_REDO(op)) {
51
 
                /* Need to undo update described. */
52
 
                modified = 1;
53
 
        }
54
 
        if (ret = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
55
 
                goto out;
56
 
 
57
 
        *lsnp = argp->prev_lsn;
58
 
        ret = 0;
59
 
 
60
 
out:    REC_CLOSE;
61
 
}
62