mirror of https://git.48k.eu/ogserver
rest: do not report error when removing image file
this file might be in a different repository, this is best effort.master
parent
ee09056908
commit
5e8e1c6467
11
src/rest.c
11
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;
|
const char *key, *image;
|
||||||
struct og_dbi *dbi;
|
struct og_dbi *dbi;
|
||||||
dbi_result result;
|
dbi_result result;
|
||||||
int rval, err = 0;
|
|
||||||
json_t *value;
|
json_t *value;
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
if (json_typeof(element) != JSON_OBJECT)
|
if (json_typeof(element) != JSON_OBJECT)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -2835,13 +2834,7 @@ static int og_cmd_delete_image(json_t *element, struct og_msg_params *params)
|
||||||
}
|
}
|
||||||
dbi_result_free(result);
|
dbi_result_free(result);
|
||||||
|
|
||||||
rval = unlink(filename);
|
unlink(filename);
|
||||||
if (rval) {
|
|
||||||
og_dbi_close(dbi);
|
|
||||||
syslog(LOG_ERR, "cannot delete image %s: %s\n",
|
|
||||||
image, strerror(errno));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
og_dbi_close(dbi);
|
og_dbi_close(dbi);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue