aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-08 00:37:28 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-08 00:37:28 +0100
commit4e1a0484e59b99b8d44c0083dcae8c117b63e1e3 (patch)
treedda2717c28d53c463deb2e3124573856bcf54d27
parent04716581779dbf4bfebbcc21469d5d40d91a57a7 (diff)
downloadslcl-4e1a0484e59b99b8d44c0083dcae8c117b63e1e3.tar.gz
main.c: Print error message only on errno != EEXIST
-rw-r--r--main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.c b/main.c
index 7914d25..53992c6 100644
--- a/main.c
+++ b/main.c
@@ -889,10 +889,11 @@ static int createdir(const struct http_payload *const p,
}
else if (mkdir(d.str, 0700))
{
- fprintf(stderr, "%s: mkdir(2): %s\n", __func__, strerror(errno));
-
if (errno != EEXIST)
+ {
+ fprintf(stderr, "%s: mkdir(2): %s\n", __func__, strerror(errno));
goto end;
+ }
else
{
static const char body[] = "<html>Directory already exists</html>";