Changeset 10584


Ignore:
Timestamp:
May 1, 2010, 4:40:53 AM (11 years ago)
Author:
charles
Message:

(1.9x libT) backport r10549 for #3172 "transmission overwrites settings.json"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.9x/libtransmission/bencode.c

    r10530 r10584  
    1212
    1313#include <assert.h>
    14 #include <ctype.h> /* isdigit */
     14#include <ctype.h> /* isdigit() */
    1515#include <errno.h>
    16 #include <math.h> /* fabs */
     16#include <limits.h> /* PATH_MAX */
     17#include <math.h> /* fabs() */
    1718#include <stdio.h>
    18 #include <stdlib.h>
     19#include <stdlib.h> /* realpath() */
    1920#include <string.h>
    2021
     
    2425#include <unistd.h> /* stat(), close() */
    2526
    26 #include <event.h> /* evbuffer */
     27#include <event.h> /* struct evbuffer */
    2728
    2829#include "ConvertUTF.h"
     
    16211622    int fd;
    16221623    int err = 0;
     1624    char buf[PATH_MAX];
     1625
     1626    /* follow symlinks to find the "real" file, to make sure the temporary
     1627     * we build with mkstemp() is created on the right partition */
     1628    if( realpath( filename, buf ) != NULL )
     1629        filename = buf;
    16231630
    16241631    /* if the file already exists, try to move it out of the way & keep it as a backup */
Note: See TracChangeset for help on using the changeset viewer.