Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dhtnet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
dhtnet
Commits
add101f9
Commit
add101f9
authored
1 year ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
fileutils: catch exceptions in removeAll
Change-Id: Ia0c3c975961bf96c6db80ed8f5c7b45bdee7e9cb
parent
b1bf24c6
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/fileutils.cpp
+18
-13
18 additions, 13 deletions
src/fileutils.cpp
with
18 additions
and
13 deletions
src/fileutils.cpp
+
18
−
13
View file @
add101f9
...
@@ -336,6 +336,7 @@ remove(const std::filesystem::path& path, bool erase)
...
@@ -336,6 +336,7 @@ remove(const std::filesystem::path& path, bool erase)
int
int
removeAll
(
const
std
::
filesystem
::
path
&
path
,
bool
erase
)
removeAll
(
const
std
::
filesystem
::
path
&
path
,
bool
erase
)
{
{
try
{
std
::
error_code
ec
;
std
::
error_code
ec
;
if
(
not
erase
)
{
if
(
not
erase
)
{
std
::
filesystem
::
remove_all
(
path
,
ec
);
std
::
filesystem
::
remove_all
(
path
,
ec
);
...
@@ -351,6 +352,10 @@ removeAll(const std::filesystem::path& path, bool erase)
...
@@ -351,6 +352,10 @@ removeAll(const std::filesystem::path& path, bool erase)
}
}
}
}
return
remove
(
path
,
erase
);
return
remove
(
path
,
erase
);
}
catch
(
const
std
::
exception
&
e
)
{
//JAMI_ERR("Error while removing %s: %s", path.c_str(), e.what());
return
-
1
;
}
}
}
void
void
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment