Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gulrak/filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
gulrak committed Mar 4, 2020
2 parents 083a981 + bd30737 commit 1a70520
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .ci/unix-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
6 changes: 6 additions & 0 deletions .ci/unix-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
cd build
ctest -E Windows
if [ -f "test/std_filesystem_test" ]; then
test/std_filesystem_test || true
fi
13 changes: 13 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
freebsd_instance:
image_family: freebsd-12-1

task:
install_script: |
pkg install -y cmake
pw groupadd testgrp
pw useradd testuser -g testgrp -w none -m
chown -R testuser:testgrp .
build_script: |
sudo -u testuser .ci/unix-build.sh
test_script: |
sudo -u testuser .ci/unix-test.sh
43 changes: 43 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
kind: pipeline
name: arm

platform:
os: linux
arch: arm

steps:
- name: build
image: alpine
failure: ignore
commands:
- apk update
- apk add --no-cache build-base cmake sudo
- addgroup testgrp
- adduser --disabled-password testuser testgrp
- passwd testuser -u -d
- chown -R testuser:testgrp .
- sudo -u testuser .ci/unix-build.sh
- sudo -u testuser .ci/unix-test.sh

---

kind: pipeline
name: arm64

platform:
os: linux
arch: arm64

steps:
- name: build
image: alpine
failure: ignore
commands:
- apk update
- apk add --no-cache build-base cmake
- addgroup testgrp
- adduser --disabled-password testuser testgrp
- passwd testuser -u -d
- chown -R testuser:testgrp .
- su -c "./.ci/unix-build.sh" testuser
- su -c "./.ci/unix-test.sh" testuser
7 changes: 4 additions & 3 deletions include/ghc/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2951,7 +2951,8 @@ template <class charT, class traits>
inline std::basic_istream<charT, traits>& operator>>(std::basic_istream<charT, traits>& is, path& p)
{
std::basic_string<charT, traits> tmp;
auto c = is.get();
charT c;
is >> c;
if (c == '"') {
auto sf = is.flags();
is >> std::noskipws;
Expand Down Expand Up @@ -3961,8 +3962,8 @@ GHC_INLINE void last_write_time(const path& p, file_time_type new_time, std::err
struct ::timespec times[2];
times[0].tv_sec = 0;
times[0].tv_nsec = UTIME_OMIT;
times[1].tv_sec = std::chrono::duration_cast<std::chrono::seconds>(d).count();
times[1].tv_nsec = std::chrono::duration_cast<std::chrono::nanoseconds>(d).count() % 1000000000;
times[1].tv_sec = static_cast<decltype(times[1].tv_sec)>(std::chrono::duration_cast<std::chrono::seconds>(d).count());
times[1].tv_nsec = static_cast<decltype(times[1].tv_nsec)>(std::chrono::duration_cast<std::chrono::nanoseconds>(d).count() % 1000000000);
if (::utimensat(AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) {
ec = detail::make_system_error();
}
Expand Down

0 comments on commit 1a70520

Please sign in to comment.