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
ea53203c
Commit
ea53203c
authored
Jan 29, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1295 from carlosmn/obsd
Fix p_realpath on OpenBSD
parents
4657fc1c
67fcac56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletions
+36
-1
src/unix/posix.h
+6
-1
src/unix/realpath.c
+30
-0
No files found.
src/unix/posix.h
View file @
ea53203c
...
...
@@ -16,7 +16,12 @@
#define p_unlink(p) unlink(p)
#define p_mkdir(p,m) mkdir(p, m)
#define p_fsync(fd) fsync(fd)
#define p_realpath(p, po) realpath(p, po)
/* The OpenBSD realpath function behaves differently */
#if !defined(__OpenBSD__)
# define p_realpath(p, po) realpath(p, po)
#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
0 → 100644
View file @
ea53203c
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#include <git2/common.h>
#ifdef __OpenBSD__
#include <limits.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
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
))
ret
;
return
NULL
;
}
#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