Changeset 1549


Ignore:
Timestamp:
Apr 22, 2016, 10:40:43 PM (9 years ago)
Author:
dmik
Message:

fontconfig: Fix broken cache file replacing on OS/2.

This was a 2.11.95 regression.

Location:
fontconfig/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified fontconfig/trunk/configure.ac

    r1546 r1549  
    114114esac
    115115AM_CONDITIONAL(OS_OS2, test "$os_os2" = "yes")
     116
     117if test "$os_os2" = "yes"; then
     118  # urpo is needed for renameForce.
     119  AC_CHECK_LIB([urpo], [renameForce])
     120fi
    116121
    117122AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
  • TabularUnified fontconfig/trunk/src/fcatomic.c

    r1207 r1549  
    5858#include <direct.h>
    5959#define mkdir(path,mode) _mkdir(path)
     60#endif
     61#ifdef __OS2__
     62#include <urpo.h>
    6063#endif
    6164
     
    198201    unlink ((const char *) atomic->file);
    199202#endif
     203#if defined(__OS2__)
     204    /*
     205     * rename in urpo doesn't expect EACCES (which it may get due FcDirCacheLock
     206     * called before initiating the cache update procedure), so force it.
     207     */
     208    if (renameForce ((char *) atomic->new, (char *) atomic->file) < 0)
     209#else
    200210    if (rename ((char *) atomic->new, (char *) atomic->file) < 0)
     211#endif
    201212        return FcFalse;
    202213    return FcTrue;
  • TabularUnified fontconfig/trunk/src/fccache.c

    r1548 r1549  
    3838#include <sys/locking.h>
    3939#endif
     40#if defined(__OS2__)
     41#include <share.h>
     42#include <io.h>
     43#endif
    4044
    4145#ifndef O_BINARY
     
    11731177        if (!cache_hashed)
    11741178            break;
     1179#if defined(__OS2__)
     1180        fd = sopen ((const char *)cache_hashed, O_RDWR, SH_DENYRW);
     1181#else
    11751182        fd = FcOpen ((const char *)cache_hashed, O_RDWR);
     1183#endif
    11761184        FcStrFree (cache_hashed);
    11771185        /* No caches in that directory. simply retry with another one */
    11781186        if (fd != -1)
    11791187        {
     1188#if !defined(__OS2__)
    11801189#if defined(_WIN32)
    11811190            if (_locking (fd, _LK_LOCK, 1) == -1)
     
    11921201                goto bail;
    11931202#endif
     1203#endif
    11941204            break;
    11951205        }
    11961206    }
    11971207    return fd;
     1208#if !defined(__OS2__)
    11981209bail:
    11991210    if (fd != -1)
    12001211        close (fd);
    12011212    return -1;
     1213#endif
    12021214}
    12031215
     
    12071219    if (fd != -1)
    12081220    {
     1221#if !defined(__OS2__)
    12091222#if defined(_WIN32)
    12101223        _locking (fd, _LK_UNLCK, 1);
     
    12181231        fl.l_pid = getpid ();
    12191232        fcntl (fd, F_SETLK, &fl);
     1233#endif
    12201234#endif
    12211235        close (fd);
Note: See TracChangeset for help on using the changeset viewer.