Commit e58c31a8 authored by Chris Lamb's avatar Chris Lamb

Inform FUSE that we wrap and thus accept the UTIME_OMIT (and UTIME_NOW) magic…

Inform FUSE that we wrap and thus accept the UTIME_OMIT (and UTIME_NOW) magic values to ensure that "touch -m …" and "touch -a …" work as expected. (Closes: #911281)
parent 80402ea8
......@@ -293,6 +293,12 @@ int main (int argc, char** argv)
* Initialize disorderfs_fuse_operations
*/
/*
* Indicate that we should accept UTIME_OMIT (and UTIME_NOW) in the
* utimens operations for "touch -m" and "touch -a"
*/
disorderfs_fuse_operations.flag_utime_omit_ok = 1;
disorderfs_fuse_operations.getattr = [] (const char* path, struct stat* st) -> int {
Guard g;
if (lstat((root + path).c_str(), st) == -1) {
......
......@@ -19,10 +19,6 @@ Fail () {
exit 1
}
XFail () {
echo "XFail: ${*}"
}
Expect () {
ENTRIES="$(Get_entries)"
EXPECTED="${1}"
......
......@@ -20,21 +20,17 @@ fi
touch ${FILENAME}
touch -m -d @${EXPECTED} ${FILENAME}
RESULT="$(stat --format=%Y ${FILENAME})"
if [ "${RESULT}" = "${EXPECTED}" ]
if [ "${RESULT}" != "${EXPECTED}" ]
then
Fail "test2: Did not XFail"
else
XFail "test2: Got=${RESULT} Expected=${EXPECTED}"
Fail "test2: Got=${RESULT} Expected=${EXPECTED}"
fi
touch ${FILENAME}
touch -a -d @${EXPECTED} ${FILENAME}
RESULT="$(stat --format=%X ${FILENAME})"
if [ "${RESULT}" = "${EXPECTED}" ]
if [ "${RESULT}" != "${EXPECTED}" ]
then
Fail "test3: Did not XFail"
else
XFail "test3: Got=${RESULT} Expected=${EXPECTED}"
Fail "test3: Got=${RESULT} Expected=${EXPECTED}"
fi
Unmount
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment