diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-10-08 10:21:24 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-10-08 10:21:24 +0300 |
commit | e86f9bcc463370f27f005439c2d8bb73a0caafbd (patch) | |
tree | de880d465fa41d6eb7ad27a6b5b21ce6d78ae386 | |
parent | 0e8a103b9aa1f2411fba665d1656f28fa297e874 (diff) | |
download | egawk-e86f9bcc463370f27f005439c2d8bb73a0caafbd.tar.gz egawk-e86f9bcc463370f27f005439c2d8bb73a0caafbd.tar.bz2 egawk-e86f9bcc463370f27f005439c2d8bb73a0caafbd.zip |
Minor cleanup in extension/inplace.c.
-rw-r--r-- | extension/ChangeLog | 5 | ||||
-rw-r--r-- | extension/inplace.c | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/extension/ChangeLog b/extension/ChangeLog index c54d3b25..3fee967f 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,8 @@ +2014-10-08 Arnold D. Robbins <arnold@skeeve.com> + + * inplace.c (do_inplace_begin): Use a cast to void in front + of the second call to chown to avoid compiler warnings from clang. + 2014-09-29 Arnold D. Robbins <arnold@skeeve.com> * filefuncs.c: Minor edits to sync with documentation. diff --git a/extension/inplace.c b/extension/inplace.c index e2f8b73f..8a7375c4 100644 --- a/extension/inplace.c +++ b/extension/inplace.c @@ -171,9 +171,8 @@ do_inplace_begin(int nargs, awk_value_t *result) /* N.B. chown/chmod should be more portable than fchown/fchmod */ if (chown(state.tname, sbuf.st_uid, sbuf.st_gid) < 0) - /* checking chown here shuts up the compiler. bleah */ - if (chown(state.tname, -1, sbuf.st_gid) < 0) - ; + (void) chown(state.tname, -1, sbuf.st_gid); + if (chmod(state.tname, sbuf.st_mode) < 0) fatal(ext_id, _("inplace_begin: chmod failed (%s)"), strerror(errno)); |