summaryrefslogtreecommitdiff
path: root/src/file.h
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2022-11-18 22:30:34 +0900
committerRyo Nakamura <upa@haeena.net>2022-11-18 22:30:34 +0900
commitdca024182489d3b517b8dc917fc84dcead825c01 (patch)
treeef0b38b301e4120bcfd58dc7731b8db88a9e0e1b /src/file.h
parentf4d04b848e180ee190427704d4b4cee26edbcf30 (diff)
add O_TRUNC when the first open() for a file
Diffstat (limited to 'src/file.h')
-rw-r--r--src/file.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/file.h b/src/file.h
index 57cd2c2..883cb32 100644
--- a/src/file.h
+++ b/src/file.h
@@ -37,7 +37,8 @@ struct file {
* if the file state of the chunk is INIT:
* acquire the file lock
* * if file state is INIT:
- * create destination file and directory if necessary
+ * create directory if necessary
+ * open file with O_TRUNC and close.
* set file state OPENED.
* // only the first thread in the lock open the destination file
* release the file lock