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
3cc60635
Commit
3cc60635
authored
Mar 05, 2010
by
Ramsay Jones
Committed by
Andreas Ericsson
Apr 30, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some more (macro) file operation wrappers
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
parent
54b9460f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
src/fileops.c
+1
-1
src/fileops.h
+4
-0
src/odb.c
+1
-1
No files found.
src/fileops.c
View file @
3cc60635
...
@@ -61,7 +61,7 @@ int gitfo_exists(const char *path)
...
@@ -61,7 +61,7 @@ int gitfo_exists(const char *path)
off_t
gitfo_size
(
git_file
fd
)
off_t
gitfo_size
(
git_file
fd
)
{
{
struct
stat
sb
;
struct
stat
sb
;
if
(
fstat
(
fd
,
&
sb
))
if
(
gitfo_
fstat
(
fd
,
&
sb
))
return
git_os_error
();
return
git_os_error
();
return
sb
.
st_size
;
return
sb
.
st_size
;
}
}
...
...
src/fileops.h
View file @
3cc60635
...
@@ -61,12 +61,16 @@ extern int gitfo_creat(const char *path, int mode);
...
@@ -61,12 +61,16 @@ extern int gitfo_creat(const char *path, int mode);
extern
int
gitfo_read
(
git_file
fd
,
void
*
buf
,
size_t
cnt
);
extern
int
gitfo_read
(
git_file
fd
,
void
*
buf
,
size_t
cnt
);
extern
int
gitfo_write
(
git_file
fd
,
void
*
buf
,
size_t
cnt
);
extern
int
gitfo_write
(
git_file
fd
,
void
*
buf
,
size_t
cnt
);
#define gitfo_lseek(f,n,w) lseek(f, n, w)
extern
off_t
gitfo_size
(
git_file
fd
);
extern
off_t
gitfo_size
(
git_file
fd
);
extern
int
gitfo_read_file
(
gitfo_buf
*
obj
,
const
char
*
path
);
extern
int
gitfo_read_file
(
gitfo_buf
*
obj
,
const
char
*
path
);
extern
void
gitfo_free_buf
(
gitfo_buf
*
obj
);
extern
void
gitfo_free_buf
(
gitfo_buf
*
obj
);
extern
int
gitfo_move_file
(
char
*
from
,
char
*
to
);
extern
int
gitfo_move_file
(
char
*
from
,
char
*
to
);
#define gitfo_stat(p,b) stat(p, b)
#define gitfo_fstat(f,b) fstat(f, b)
#define gitfo_unlink(p) unlink(p)
#define gitfo_unlink(p) unlink(p)
#define gitfo_rmdir(p) rmdir(p)
#define gitfo_rmdir(p) rmdir(p)
#define gitfo_chdir(p) chdir(p)
#define gitfo_chdir(p) chdir(p)
...
...
src/odb.c
View file @
3cc60635
...
@@ -1016,7 +1016,7 @@ static int pack_stat(git_pack *p)
...
@@ -1016,7 +1016,7 @@ static int pack_stat(git_pack *p)
p
->
pack_name
)
<
0
)
p
->
pack_name
)
<
0
)
return
GIT_ERROR
;
return
GIT_ERROR
;
if
(
stat
(
pb
,
&
sb
)
||
!
S_ISREG
(
sb
.
st_mode
))
if
(
gitfo_
stat
(
pb
,
&
sb
)
||
!
S_ISREG
(
sb
.
st_mode
))
return
GIT_ERROR
;
return
GIT_ERROR
;
if
(
sb
.
st_size
<
(
3
*
4
+
GIT_OID_RAWSZ
))
if
(
sb
.
st_size
<
(
3
*
4
+
GIT_OID_RAWSZ
))
...
...
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