Skip to content
Snippets Groups Projects
  1. Sep 21, 2017
  2. Sep 13, 2017
    • Colin Walters's avatar
      dirfd: Extend tmpdir API to support optional cleaning · 0428fd87
      Colin Walters authored
      We have a use case in libostree's staging dirs where we try to reuse
      them across multiple ostree txns, but we want the fd-relative bits
      here.
      
      Extend the tmpdir API to make deletion optional. While here, also extend the API
      to support checking for errors when deleting for projects like libostree that
      want to do so consistently.
      
      Also while here, add a change to set the fd to `-1` after clearing to be extra
      defensive.
      0428fd87
  3. Aug 18, 2017
    • Colin Walters's avatar
      dirfd: New tmpdir API · 7100ebbc
      Colin Walters authored
      Basically all of the ostree/rpm-ostree callers want to both create and open, so
      let's merge `glnx_mkdtempat()` and `glnx_mkdtempat_open()`.
      
      Second, all of them want to do `glnx_shutil_rm_rf_at()` on cleanup, so we do the
      same thing we did with `GLnxTmpfile` and create `GLnxTmpDir` that has a cleanup
      attribute.
      
      The cleanup this results in for rpm-ostree is pretty substantial.
      7100ebbc
  4. Jul 20, 2017
    • Colin Walters's avatar
      dirfd: Add missing includes for errno · 1468b70d
      Colin Walters authored
      Thought the previous patch would have been obvious enough not
      to compile test but...
      1468b70d
    • Colin Walters's avatar
      dirfd: Add glnx_ensure_dir() · 1c0bfd24
      Colin Walters authored
      Another one where we have a lot of inlines in ostree at least. Not the same as
      `glnx_shutil_mkdir_p_at()` since in these cases we don't want automatic
      intermediate dirs, and it's cheaper to just call `mkdirat()` and handle `EEXIST`
      rather than do a `stat()` first.
      1c0bfd24
  5. May 31, 2017
    • Colin Walters's avatar
      dirfd: Have dfd iter _take_fd() take a pointer and do a steal · f5ba01cf
      Colin Walters authored
      This avoids callers having to use `glnx_steal_fd()` on their own; in general, I
      think we should implement move semantics like this at the callee level.
      
      Another reason to do this is there's a subtle problem with doing:
      
      ```
      somefunction (steal_value (&v), ..., error);
      ```
      
      in that if `somefunction` throws, it may not have taken ownership of the value.
      At least `glnx_dirfd_iterator_init_take_fd()` didn't.
      f5ba01cf
  6. Apr 21, 2017
  7. May 30, 2016
    • Colin Walters's avatar
      Introduce glnx_gen_temp_name() · 4919f6ee
      Colin Walters authored
      We have multiple copies growing again of this code.  glibc has this
      API internally and uses it in multiple places, let's do the same.
      
      Closes: #14
      4919f6ee
  8. Jan 03, 2016
    • Colin Walters's avatar
      dirfd: Add a public API to ensure a filled dtype · 91e06069
      Colin Walters authored
      It's quite common to iterate over a directory recursively, only caring
      about the file type, but not other bits returned by `stat()`.
      
      Good file systems fill in `dt_type`, but not all do.  This function
      papers over that in userspace conveniently.
      91e06069
  9. Dec 11, 2015
  10. Apr 17, 2015
    • Colin Walters's avatar
      dirfd: Add API to get an absolute path from a dfd/relpath · 381ca54e
      Colin Walters authored
      There are a lot of APIs that still only take absolute paths, such as
      librpm (and everything above it).  I plan to use this in rpm-ostree to
      convert temporary directories that I'm accessing fd-relative back into
      absolutes until such time as fd-relative APIs are plumbed through the
      stack more.
      381ca54e
  11. Mar 17, 2015
  12. Feb 18, 2015
  13. Feb 15, 2015
Loading