add O_TRUNC to oflags in webdav_put webdav

Sun, 08 May 2022 10:41:27 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 08 May 2022 10:41:27 +0200
branch
webdav
changeset 340
03c052d9a097
parent 339
f4a34b0869c7
child 341
52831b82b3fd

add O_TRUNC to oflags in webdav_put

src/server/webdav/webdav.c file | annotate | diff | comparison | revisions
--- a/src/server/webdav/webdav.c	Sun May 08 10:33:41 2022 +0200
+++ b/src/server/webdav/webdav.c	Sun May 08 10:41:27 2022 +0200
@@ -693,7 +693,7 @@
         return REQ_ABORTED;
     }
     
-    SYS_FILE fd = vfs_open(vfs, path, O_WRONLY | create_file);
+    SYS_FILE fd = vfs_open(vfs, path, O_WRONLY | O_TRUNC | create_file);
     if(!fd) {
         // if it fails, vfs_open sets http status code
         return REQ_ABORTED;

mercurial