Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/lib/tdb/tools/tdbtest.c

    r414 r745  
    216216}
    217217
     218static char *test_path(const char *filename)
     219{
     220        const char *prefix = getenv("TEST_DATA_PREFIX");
     221
     222        if (prefix) {
     223                char *path = NULL;
     224                int ret;
     225
     226                ret = asprintf(&path, "%s/%s", prefix, filename);
     227                if (ret == -1) {
     228                        return NULL;
     229                }
     230                return path;
     231        }
     232
     233        return strdup(filename);
     234}
     235
    218236 int main(int argc, const char *argv[])
    219237{
     
    221239        int loops = 10000;
    222240        int num_entries;
    223         char test_gdbm[] = "test.gdbm";
    224 
    225         unlink("test.gdbm");
    226 
    227         db = tdb_open("test.tdb", 0, TDB_CLEAR_IF_FIRST,
     241        char test_gdbm[1] = "test.gdbm";
     242        char *test_tdb;
     243
     244        test_gdbm[0] = test_path("test.gdbm");
     245        test_tdb = test_path("test.tdb");
     246
     247        unlink(test_gdbm[0]);
     248
     249        db = tdb_open(test_tdb, 0, TDB_CLEAR_IF_FIRST,
    228250                      O_RDWR | O_CREAT | O_TRUNC, 0600);
    229251        gdbm = gdbm_open(test_gdbm, 512, GDBM_WRITER|GDBM_NEWDB|GDBM_FAST,
     
    262284        gdbm_close(gdbm);
    263285
     286        free(test_gdbm[0]);
     287        free(test_tdb);
     288
    264289        return 0;
    265290}
Note: See TracChangeset for help on using the changeset viewer.