~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/cslib/CSPath.cc

  • Committer: Monty Taylor
  • Date: 2011-03-11 18:48:55 UTC
  • mfrom: (2228.1.8 build)
  • Revision ID: mordred@inaugust.com-20110311184855-1essd3a6xfr7lx6r
Merged Andrew: drizzledump and docs bug fixes
Merged Barry: pbms bugfixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
 
55
55
CSFile *CSPath::try_CreateAndOpen(CSThread *self, int mode, bool retry)
56
56
{
 
57
        volatile CSFile *fh = NULL;
 
58
        
57
59
        try_(a) {
58
 
                return openFile(mode | CSFile::CREATE); // success, do not try again.
 
60
                fh = openFile(mode | CSFile::CREATE); // success, do not try again.
59
61
        }
60
62
        catch_(a) {
61
63
                if (retry || !CSFile::isDirNotFound(&self->myException))
69
71
 
70
72
        }
71
73
        cont_(a);
72
 
        return NULL; 
 
74
        return (CSFile *) fh; 
73
75
}
74
76
 
75
77
CSFile *CSPath::createFile(int mode)
526
528
void CSPath::move(CSPath *to_path)
527
529
{
528
530
        enter_();
 
531
        push_(to_path);
529
532
        lock_(&iRename_lock); // protect against race condition when testing if the new name exists yet or not. 
530
533
        if (to_path->exists())
531
534
                CSException::throwFileError(CS_CONTEXT, to_path->getCString(), EEXIST);
533
536
        /* Cannot move from TD to non-TD: */
534
537
        sys_rename(iPath->getCString(), to_path->getCString());
535
538
        unlock_(&iRename_lock);
 
539
        release_(to_path);
536
540
        exit_();
537
541
}
538
542