aboutsummaryrefslogtreecommitdiffstats
path: root/extension
diff options
context:
space:
mode:
Diffstat (limited to 'extension')
-rw-r--r--extension/ChangeLog10
-rw-r--r--extension/filefuncs.c4
-rw-r--r--extension/inplace.c5
-rw-r--r--extension/testext.c6
4 files changed, 20 insertions, 5 deletions
diff --git a/extension/ChangeLog b/extension/ChangeLog
index c7974e48..82ae5b69 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,13 @@
+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.
+ * testext.c: Add test to get PROCINFO, expected to fail.
+
2014-08-12 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (RM): Define for makes that don't have it,
diff --git a/extension/filefuncs.c b/extension/filefuncs.c
index d5249a4e..a20e9ff7 100644
--- a/extension/filefuncs.c
+++ b/extension/filefuncs.c
@@ -145,7 +145,7 @@ static const char *ext_version = "filefuncs extension: version 1.0";
int plugin_is_GPL_compatible;
-/* do_chdir --- provide dynamically loaded chdir() builtin for gawk */
+/* do_chdir --- provide dynamically loaded chdir() function for gawk */
static awk_value_t *
do_chdir(int nargs, awk_value_t *result)
@@ -448,7 +448,7 @@ fill_stat_array(const char *name, awk_array_t array, struct stat *sbuf)
}
}
- array_set(array, "type", make_const_string(type, strlen(type), &tmp));
+ array_set(array, "type", make_const_string(type, strlen(type), & tmp));
return 0;
}
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));
diff --git a/extension/testext.c b/extension/testext.c
index 2dda339f..7462265b 100644
--- a/extension/testext.c
+++ b/extension/testext.c
@@ -302,6 +302,12 @@ var_test(int nargs, awk_value_t *result)
goto out;
}
+ /* look up PROCINFO - should fail */
+ if (sym_lookup("PROCINFO", AWK_ARRAY, & value))
+ printf("var_test: sym_lookup of PROCINFO failed - got a value!\n");
+ else
+ printf("var_test: sym_lookup of PROCINFO passed - did not get a value\n");
+
/* look up a reserved variable - should pass */
if (sym_lookup("ARGC", AWK_NUMBER, & value))
printf("var_test: sym_lookup of ARGC passed - got a value!\n");