]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common: skip undefined open flags on Windows
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 18 Oct 2019 09:49:11 +0000 (09:49 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Mon, 27 Jul 2020 08:25:38 +0000 (08:25 +0000)
O_NOFOLLOW and O_DIRECTORY are not available on Windows.
We'll just skip those flags for now when converting flags.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
src/common/ceph_fs.cc

index 7a4b59f872a9766d960c79ff2797111301521c86..380b401df301a5755a7bf02452448f6ef1fe96f9 100644 (file)
@@ -76,8 +76,14 @@ int ceph_flags_sys2wire(int flags)
        ceph_sys2wire(O_CREAT);
        ceph_sys2wire(O_EXCL);
        ceph_sys2wire(O_TRUNC);
+
+       #ifndef _WIN32
        ceph_sys2wire(O_DIRECTORY);
        ceph_sys2wire(O_NOFOLLOW);
+       // In some cases, FILE_FLAG_BACKUP_SEMANTICS may be used instead
+       // of O_DIRECTORY. We may need some workarounds in order to handle
+       // the fact that those flags are not available on Windows.
+       #endif
 
 #undef ceph_sys2wire