diff options
author | Colin Walters <walters@verbum.org> | 2017-10-17 11:18:26 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-10-17 16:43:02 +0000 |
commit | 9955695da31cbf49465ab8e3b0135166b067452c (patch) | |
tree | 7137b146128fd43c954662e57a61d7370b86580f | |
parent | 3577b4a6c633f633cc906131abf889d5e333b795 (diff) | |
download | ostree-9955695da31cbf49465ab8e3b0135166b067452c.tar.gz |
syntax-check: Add a rule to enforce glnx_autofd over glnx_fd_close
And fix the one final use.
Closes: #1280
Approved by: jlebon
-rw-r--r-- | cfg.mk | 6 | ||||
-rw-r--r-- | src/libostree/ostree-repo-commit.c | 2 |
2 files changed, 6 insertions, 2 deletions
@@ -31,8 +31,12 @@ sc_glnx_errno_prefix_colon: @prohibit='\<glnx_throw_errno_prefix *\(.*: ",' halt="don't add trailing : for glnx_throw_errno_prefix" \ $(_sc_search_regexp) +sc_glnx_no_fd_close: + @prohibit='\<glnx_fd_close int' halt="Use glnx_autofd, not glnx_fd_close" \ + $(_sc_search_regexp) + #SHELL=bash -x show-vc-list-except: @$(VC_LIST_EXCEPT) -VC_LIST_ALWAYS_EXCLUDE_REGEX = ^ABOUT-NLS|maint.mk|*.gpg|*.sig|.xz$$ +VC_LIST_ALWAYS_EXCLUDE_REGEX = ^ABOUT-NLS|cfg.mk|maint.mk|*.gpg|*.sig|.xz$$ diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c index 164003f7..e1649c1d 100644 --- a/src/libostree/ostree-repo-commit.c +++ b/src/libostree/ostree-repo-commit.c @@ -821,7 +821,7 @@ adopt_and_commit_regfile (OstreeRepo *self, ot_checksum_init (&hasher); ot_checksum_update_bytes (&hasher, header); - glnx_fd_close int fd = -1; + glnx_autofd int fd = -1; if (!glnx_openat_rdonly (dfd, name, FALSE, &fd, error)) return FALSE; |