This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository efm2.
View the commit online.
commit 9c0cff7d786deda9e4767c6b3ab26f89ab93701f
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
AuthorDate: Sun May 26 16:52:56 2024 +0100
come code cleaning
---
src/backends/default/fs.c | 44 +++++++++++++++++---------------------------
1 file changed, 17 insertions(+), 27 deletions(-)
diff --git a/src/backends/default/fs.c b/src/backends/default/fs.c
index 9fb37a9..affe9b3 100644
--- a/src/backends/default/fs.c
+++ b/src/backends/default/fs.c
@@ -244,6 +244,7 @@ fs_cp_rm(const char *src, const char *dst, Eina_Bool report_err, Eina_Bool cp,
mode_t old_umask;
struct timeval times[2];
const char *op = "";
+ int ret;
if ((!src) || (!dst) || (strlen(src) < 1)) return EINA_FALSE;
@@ -287,7 +288,11 @@ fs_cp_rm(const char *src, const char *dst, Eina_Bool report_err, Eina_Bool cp,
{
Eina_Strbuf *buf = eina_strbuf_new();
- if (!buf) abort();
+ if (!buf)
+ {
+ fprintf(stderr, "Out of memory!\n");
+ abort();
+ }
EINA_ITERATOR_FOREACH(it, s)
{
const char *fs = ecore_file_file_get(s);
@@ -377,34 +382,19 @@ fs_cp_rm(const char *src, const char *dst, Eina_Bool report_err, Eina_Bool cp,
}
if ((rm) && (res))
{
- if (S_ISDIR(st.st_mode))
+ ret = 0;
+ if (S_ISDIR(st.st_mode)) ret = rmdir(src);
+ else ret = unlink(src);
+ if (ret != 0)
{
- if (rmdir(src) != 0)
+ switch (errno)
{
- switch (errno)
- {
- case ENOENT: // ignore missing
- break;
- default:
- _error_handle(src, NULL, op, errno);
- res = EINA_FALSE;
- goto err_unlink;
- }
- }
- }
- else
- {
- if (unlink(src) != 0)
- {
- switch (errno)
- {
- case ENOENT: // ignore missing
- break;
- default:
- _error_handle(src, NULL, op, errno);
- res = EINA_FALSE;
- goto err_unlink;
- }
+ case ENOENT: // ignore missing
+ break;
+ default:
+ _error_handle(src, NULL, op, errno);
+ res = EINA_FALSE;
+ goto err_unlink;
}
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.