From c94931edf30d81eb9084c24694ba4af15517fdad Mon Sep 17 00:00:00 2001 From: alfred Date: Sat, 11 May 2002 04:17:55 +0000 Subject: replace __FUNCTION__ with standardized __func__. Requested by: jhb --- usr.sbin/pkg_install/lib/deps.c | 2 +- usr.sbin/pkg_install/lib/file.c | 18 +++++++++--------- usr.sbin/pkg_install/lib/match.c | 8 ++++---- usr.sbin/pkg_install/lib/pen.c | 14 +++++++------- usr.sbin/pkg_install/lib/plist.c | 4 ++-- 5 files changed, 23 insertions(+), 23 deletions(-) (limited to 'usr.sbin/pkg_install/lib') diff --git a/usr.sbin/pkg_install/lib/deps.c b/usr.sbin/pkg_install/lib/deps.c index aea2788..cf366f0 100644 --- a/usr.sbin/pkg_install/lib/deps.c +++ b/usr.sbin/pkg_install/lib/deps.c @@ -185,7 +185,7 @@ requiredby(const char *pkgname, struct reqr_by_head **list, Boolean strict, Bool retval++; rb_entry = malloc(sizeof(*rb_entry)); if (rb_entry == NULL) { - warnx("%s(): malloc() failed", __FUNCTION__); + warnx("%s(): malloc() failed", __func__); retval = -1; break; } 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); } } diff --git a/usr.sbin/pkg_install/lib/match.c b/usr.sbin/pkg_install/lib/match.c index 90b6979..5671406 100644 --- a/usr.sbin/pkg_install/lib/match.c +++ b/usr.sbin/pkg_install/lib/match.c @@ -66,7 +66,7 @@ matchinstalled(match_t MatchType, char **patterns, int *retval) if (store == NULL) { store = malloc(sizeof *store); if (store == NULL) { - warnx("%s(): malloc() failed", __FUNCTION__); + warnx("%s(): malloc() failed", __func__); if (retval != NULL) *retval = 1; return NULL; @@ -95,7 +95,7 @@ matchinstalled(match_t MatchType, char **patterns, int *retval) for (len = 0; patterns[len]; len++) {} lmatched = alloca(sizeof(*lmatched) * len); if (lmatched == NULL) { - warnx("%s(): alloca() failed", __FUNCTION__); + warnx("%s(): alloca() failed", __func__); if (retval != NULL) *retval = 1; return NULL; @@ -203,14 +203,14 @@ storeappend(struct store *store, const char *item) store->currlen * sizeof(*(store->store))); if (store->store == NULL) { store->currlen = 0; - warnx("%s(): reallocf() failed", __FUNCTION__); + warnx("%s(): reallocf() failed", __func__); return 1; } } asprintf(&(store->store[store->used]), "%s", item); if (store->store[store->used] == NULL) { - warnx("%s(): malloc() failed", __FUNCTION__); + warnx("%s(): malloc() failed", __func__); return 1; } store->used++; diff --git a/usr.sbin/pkg_install/lib/pen.c b/usr.sbin/pkg_install/lib/pen.c index 5879108..eedda00 100644 --- a/usr.sbin/pkg_install/lib/pen.c +++ b/usr.sbin/pkg_install/lib/pen.c @@ -62,7 +62,7 @@ find_play_pen(char *pen, off_t sz) errx(2, "%s: can't find enough temporary space to extract the files, please set your\n" "PKG_TMPDIR environment variable to a location with at least %ld bytes\n" -"free", __FUNCTION__, (long)sz); +"free", __func__, (long)sz); return NULL; } return pen; @@ -76,7 +76,7 @@ static void pushPen(const char *pen) { if (++pdepth == MAX_STACK) - errx(2, "%s: stack overflow.\n", __FUNCTION__); + errx(2, "%s: stack overflow.\n", __func__); pstack[pdepth] = strdup(pen); } @@ -103,11 +103,11 @@ make_playpen(char *pen, off_t sz) if (!mkdtemp(pen)) { cleanup(0); - errx(2, "%s: can't mktemp '%s'", __FUNCTION__, pen); + errx(2, "%s: can't mktemp '%s'", __func__, pen); } if (chmod(pen, 0700) == FAIL) { cleanup(0); - errx(2, "%s: can't mkdir '%s'", __FUNCTION__, pen); + errx(2, "%s: can't mkdir '%s'", __func__, pen); } if (Verbose) { @@ -120,7 +120,7 @@ make_playpen(char *pen, off_t sz) cleanup(0); errx(2, "%s: not enough free space to create '%s'.\n" "Please set your PKG_TMPDIR environment variable to a location\n" - "with more space and\ntry the command again", __FUNCTION__, pen); + "with more space and\ntry the command again", __func__, pen); } if (!getcwd(Previous, FILENAME_MAX)) { @@ -130,7 +130,7 @@ make_playpen(char *pen, off_t sz) if (chdir(pen) == FAIL) { cleanup(0); - errx(2, "%s: can't chdir to '%s'", __FUNCTION__, pen); + errx(2, "%s: can't chdir to '%s'", __func__, pen); } if (PenLocation[0]) @@ -151,7 +151,7 @@ leave_playpen() if (Previous[0]) { if (chdir(Previous) == FAIL) { cleanup(0); - errx(2, "%s: can't chdir back to '%s'", __FUNCTION__, Previous); + errx(2, "%s: can't chdir back to '%s'", __func__, Previous); } Previous[0] = '\0'; } diff --git a/usr.sbin/pkg_install/lib/plist.c b/usr.sbin/pkg_install/lib/plist.c index 0f7a010..603588e 100644 --- a/usr.sbin/pkg_install/lib/plist.c +++ b/usr.sbin/pkg_install/lib/plist.c @@ -275,7 +275,7 @@ read_plist(Package *pkg, FILE *fp) cmd = plist_cmd(pline + 1, &cp); if (cmd == FAIL) { cleanup(0); - errx(2, "%s: bad command '%s'", __FUNCTION__, pline); + errx(2, "%s: bad command '%s'", __func__, pline); } if (*cp == '\0') { cp = NULL; @@ -384,7 +384,7 @@ write_plist(Package *pkg, FILE *fp) default: cleanup(0); - errx(2, "%s: unknown command type %d (%s)", __FUNCTION__, + errx(2, "%s: unknown command type %d (%s)", __func__, plist->type, plist->name); break; } -- cgit v1.1