summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/lib/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pkg_install/lib/file.c')
-rw-r--r--usr.sbin/pkg_install/lib/file.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c
index df87201..163517a 100644
--- a/usr.sbin/pkg_install/lib/file.c
+++ b/usr.sbin/pkg_install/lib/file.c
@@ -300,18 +300,18 @@ fileGetContents(const char *fname)
if (stat(fname, &sb) == FAIL) {
cleanup(0);
- errx(2, "%s: can't stat '%s'", __FUNCTION__, fname);
+ errx(2, "%s: can't stat '%s'", __func__, fname);
}
contents = (char *)malloc(sb.st_size + 1);
fd = open(fname, O_RDONLY, 0);
if (fd == FAIL) {
cleanup(0);
- errx(2, "%s: unable to open '%s' for reading", __FUNCTION__, fname);
+ errx(2, "%s: unable to open '%s' for reading", __func__, fname);
}
if (read(fd, contents, sb.st_size) != sb.st_size) {
cleanup(0);
- errx(2, "%s: short read on '%s' - did not get %qd bytes", __FUNCTION__,
+ errx(2, "%s: short read on '%s' - did not get %qd bytes", __func__,
fname, (long long)sb.st_size);
}
close(fd);
@@ -364,17 +364,17 @@ write_file(const char *name, const char *str)
fp = fopen(name, "w");
if (!fp) {
cleanup(0);
- errx(2, "%s: cannot fopen '%s' for writing", __FUNCTION__, name);
+ errx(2, "%s: cannot fopen '%s' for writing", __func__, name);
}
len = strlen(str);
if (fwrite(str, 1, len, fp) != len) {
cleanup(0);
errx(2, "%s: short fwrite on '%s', tried to write %ld bytes",
- __FUNCTION__, name, (long)len);
+ __func__, name, (long)len);
}
if (fclose(fp)) {
cleanup(0);
- errx(2, "%s: failure to fclose '%s'", __FUNCTION__, name);
+ errx(2, "%s: failure to fclose '%s'", __func__, name);
}
}
@@ -389,7 +389,7 @@ copy_file(const char *dir, const char *fname, const char *to)
snprintf(cmd, FILENAME_MAX, "cp -r %s/%s %s", dir, fname, to);
if (vsystem(cmd)) {
cleanup(0);
- errx(2, "%s: could not perform '%s'", __FUNCTION__, cmd);
+ errx(2, "%s: could not perform '%s'", __func__, cmd);
}
}
@@ -404,7 +404,7 @@ move_file(const char *dir, const char *fname, const char *to)
snprintf(cmd, FILENAME_MAX, "mv %s/%s %s", dir, fname, to);
if (vsystem(cmd)) {
cleanup(0);
- errx(2, "%s: could not perform '%s'", __FUNCTION__, cmd);
+ errx(2, "%s: could not perform '%s'", __func__, cmd);
}
}
@@ -436,7 +436,7 @@ copy_hierarchy(const char *dir, const char *fname, Boolean to)
#endif
if (system(cmd)) {
cleanup(0);
- errx(2, "%s: could not perform '%s'", __FUNCTION__, cmd);
+ errx(2, "%s: could not perform '%s'", __func__, cmd);
}
}
OpenPOWER on IntegriCloud