aboutsummaryrefslogtreecommitdiffstats
path: root/extension/inplace.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-11-23 19:56:27 +0200
committerArnold D. Robbins <arnold@skeeve.com>2014-11-23 19:56:27 +0200
commit2513062a4c89b0b60c3717d506fce841d44d871e (patch)
treeae2a21e0a0e0173c1c8b44e9e087da1ab357d66b /extension/inplace.c
parent838f65088cda84edc2df609d3e388acb3c8eb13d (diff)
downloadegawk-2513062a4c89b0b60c3717d506fce841d44d871e.tar.gz
egawk-2513062a4c89b0b60c3717d506fce841d44d871e.tar.bz2
egawk-2513062a4c89b0b60c3717d506fce841d44d871e.zip
Fix compile problems and warnings on current GCC (4.9.2).
Diffstat (limited to 'extension/inplace.c')
-rw-r--r--extension/inplace.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/extension/inplace.c b/extension/inplace.c
index 8a7375c4..0693ad92 100644
--- a/extension/inplace.c
+++ b/extension/inplace.c
@@ -170,8 +170,12 @@ do_inplace_begin(int nargs, awk_value_t *result)
state.tname, strerror(errno));
/* N.B. chown/chmod should be more portable than fchown/fchmod */
- if (chown(state.tname, sbuf.st_uid, sbuf.st_gid) < 0)
- (void) chown(state.tname, -1, sbuf.st_gid);
+ if (chown(state.tname, sbuf.st_uid, sbuf.st_gid) < 0) {
+ /* jumping through hoops to silence gcc. :-( */
+ int junk;
+ junk = chown(state.tname, -1, sbuf.st_gid);
+ junk = junk;
+ }
if (chmod(state.tname, sbuf.st_mode) < 0)
fatal(ext_id, _("inplace_begin: chmod failed (%s)"),