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
f9b4adbe
Commit
f9b4adbe
authored
Jan 05, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1194 from libgit2/dont-clobber-errors
git_mwindow_file_deregister() shouldn't return errors
parents
d74b1bc5
f9b55bcb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
10 deletions
+5
-10
src/mwindow.c
+4
-9
src/mwindow.h
+1
-1
No files found.
src/mwindow.c
View file @
f9b4adbe
...
...
@@ -293,28 +293,23 @@ int git_mwindow_file_register(git_mwindow_file *mwf)
return
ret
;
}
int
git_mwindow_file_deregister
(
git_mwindow_file
*
mwf
)
void
git_mwindow_file_deregister
(
git_mwindow_file
*
mwf
)
{
git_mwindow_ctl
*
ctl
=
&
mem_ctl
;
git_mwindow_file
*
cur
;
unsigned
int
i
;
if
(
git_mutex_lock
(
&
git__mwindow_mutex
))
{
giterr_set
(
GITERR_THREAD
,
"unable to lock mwindow mutex"
);
return
-
1
;
}
if
(
git_mutex_lock
(
&
git__mwindow_mutex
))
return
;
git_vector_foreach
(
&
ctl
->
windowfiles
,
i
,
cur
)
{
if
(
cur
==
mwf
)
{
git_vector_remove
(
&
ctl
->
windowfiles
,
i
);
git_mutex_unlock
(
&
git__mwindow_mutex
);
return
0
;
return
;
}
}
git_mutex_unlock
(
&
git__mwindow_mutex
);
giterr_set
(
GITERR_ODB
,
"Failed to find the memory window file to deregister"
);
return
-
1
;
}
void
git_mwindow_close
(
git_mwindow
**
window
)
...
...
src/mwindow.h
View file @
f9b4adbe
...
...
@@ -39,7 +39,7 @@ int git_mwindow_contains(git_mwindow *win, git_off_t offset);
void
git_mwindow_free_all
(
git_mwindow_file
*
mwf
);
unsigned
char
*
git_mwindow_open
(
git_mwindow_file
*
mwf
,
git_mwindow
**
cursor
,
git_off_t
offset
,
size_t
extra
,
unsigned
int
*
left
);
int
git_mwindow_file_register
(
git_mwindow_file
*
mwf
);
int
git_mwindow_file_deregister
(
git_mwindow_file
*
mwf
);
void
git_mwindow_file_deregister
(
git_mwindow_file
*
mwf
);
void
git_mwindow_close
(
git_mwindow
**
w_cursor
);
#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