mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
(trunk, libt) #4160 - the slow slog to catch trunk up to mike.dld's 4160 diff continues. This step applies 4160-04b-dir.patch, which replaces native file operations with the tr_sys_dir_*() portability wrappers added in the previous commit.
This commit is contained in:
@@ -9,24 +9,19 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h> /* isspace */
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h> /* strcmp */
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <direct.h> /* getcwd */
|
||||
#else
|
||||
#include <unistd.h> /* getcwd */
|
||||
#endif
|
||||
|
||||
#include <event2/buffer.h>
|
||||
|
||||
#define CURL_DISABLE_TYPECHECK /* otherwise -Wunreachable-code goes insane */
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/error.h>
|
||||
#include <libtransmission/file.h>
|
||||
#include <libtransmission/log.h>
|
||||
#include <libtransmission/rpcimpl.h>
|
||||
#include <libtransmission/tr-getopt.h>
|
||||
@@ -498,21 +493,18 @@ static char*
|
||||
tr_getcwd (void)
|
||||
{
|
||||
char * result;
|
||||
char buf[2048];
|
||||
tr_error * error = NULL;
|
||||
|
||||
#ifdef _WIN32
|
||||
result = _getcwd (buf, sizeof (buf));
|
||||
#else
|
||||
result = getcwd (buf, sizeof (buf));
|
||||
#endif
|
||||
result = tr_sys_dir_get_current (&error);
|
||||
|
||||
if (result == NULL)
|
||||
{
|
||||
fprintf (stderr, "getcwd error: \"%s\"", tr_strerror (errno));
|
||||
*buf = '\0';
|
||||
fprintf (stderr, "getcwd error: \"%s\"", error->message);
|
||||
tr_error_free (error);
|
||||
result = tr_strdup ("");
|
||||
}
|
||||
|
||||
return tr_strdup (buf);
|
||||
return result;
|
||||
}
|
||||
|
||||
static char*
|
||||
|
||||
Reference in New Issue
Block a user