Details

[Home]

Issue of the Implementation # S0590

Brief

Incorrect return value of FcAtomicLock

Detailed Description

The description of the function FcAtomicLock states: "Returns FcFalse if the file is locked by another process, else returns FcTrue and leaves the file locked.". So if we try to lock the file for the second time from the same process the function should return FcTrue.

However the implementation of the function FcAtomicLock returns FcFalse in this case.

Problem location(s) in the standard

Fontconfig Developers Reference, Version 2.4.2

Example

#define FILE1 any_file //any existing file here
FcAtomic  *fca;
FcBool    b1, b2;

    if (!(fca = FcAtomicCreate ((FcChar8 *)FILE1)))
    {
        printf ("Could not create FcAtomic\n");
    }
    printf("Trying to lock the file %s\n", (char*)FILE1);
    b1 = FcAtomicLock (fca);
    b2 = FcAtomicLock (fca);  

    /* 
     * b2 have to be FcTrue but it is FcFalse
     */

Component

fontconfig 2.2.3 or later

Accepted

freedesktop.org Bugzilla 12947

Status

Fixed in fontconfig 2.5.0

[Home]