Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
662f90e6
Commit
662f90e6
authored
Jul 13, 2014
by
Jacques Germishuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move p_realpath logic to realpath.c
parent
c7dd0a56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
14 deletions
+9
-14
src/unix/posix.h
+1
-7
src/unix/realpath.c
+8
-7
No files found.
src/unix/posix.h
View file @
662f90e6
...
...
@@ -26,18 +26,12 @@ typedef int GIT_SOCKET;
#define p_unlink(p) unlink(p)
#define p_mkdir(p,m) mkdir(p, m)
#define p_fsync(fd) fsync(fd)
extern
char
*
p_realpath
(
const
char
*
,
char
*
);
#define p_recv(s,b,l,f) recv(s,b,l,f)
#define p_send(s,b,l,f) send(s,b,l,f)
#define p_inet_pton(a, b, c) inet_pton(a, b, c)
/* The OpenBSD realpath function behaves differently */
#if !defined(__OpenBSD__)
# define p_realpath(p, po) realpath(p, po)
#else
char
*
p_realpath
(
const
char
*
,
char
*
);
#endif
#define p_vsnprintf(b, c, f, a) vsnprintf(b, c, f, a)
#define p_snprintf(b, c, f, ...) snprintf(b, c, f, __VA_ARGS__)
#define p_mkstemp(p) mkstemp(p)
...
...
src/unix/realpath.c
View file @
662f90e6
...
...
@@ -6,7 +6,7 @@
*/
#include <git2/common.h>
#if
def __OpenBSD__
#if
ndef GIT_WIN32
#include <limits.h>
#include <stdlib.h>
...
...
@@ -16,15 +16,16 @@
char
*
p_realpath
(
const
char
*
pathname
,
char
*
resolved
)
{
char
*
ret
;
if
((
ret
=
realpath
(
pathname
,
resolved
))
==
NULL
)
return
NULL
;
/* Figure out if the file exists */
if
(
!
access
(
ret
,
F_OK
))
return
ret
;
return
NULL
;
#ifdef __OpenBSD__
/* The OpenBSD realpath function behaves differently,
* figure out if the file exists */
if
(
access
(
ret
,
F_OK
)
<
0
)
ret
=
NULL
;
#endif
return
ret
;
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment