From 5e8e1c6467e7d31a5042dc603d0da07f8f6e738e Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Fri, 15 Dec 2023 11:10:47 +0100 Subject: rest: do not report error when removing image file this file might be in a different repository, this is best effort. --- src/rest.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/rest.c b/src/rest.c index 0b252e2..a6dafbc 100644 --- a/src/rest.c +++ b/src/rest.c @@ -2771,9 +2771,8 @@ static int og_cmd_delete_image(json_t *element, struct og_msg_params *params) const char *key, *image; struct og_dbi *dbi; dbi_result result; - int rval, err = 0; json_t *value; - + int err = 0; if (json_typeof(element) != JSON_OBJECT) return -1; @@ -2835,13 +2834,7 @@ static int og_cmd_delete_image(json_t *element, struct og_msg_params *params) } dbi_result_free(result); - rval = unlink(filename); - if (rval) { - og_dbi_close(dbi); - syslog(LOG_ERR, "cannot delete image %s: %s\n", - image, strerror(errno)); - return -1; - } + unlink(filename); og_dbi_close(dbi); return 0; -- cgit v1.2.3-18-g5258