diff options
author | alfred <alfred@FreeBSD.org> | 2002-05-11 03:48:49 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-05-11 03:48:49 +0000 |
commit | 7be446ee1c9d1c224ed502e2943f86134e3e174f (patch) | |
tree | dfb1883ff0dc02633230f624e01908bce5789799 /usr.sbin/pkg_install/create | |
parent | 02509bfc4bc35c1903d356df602509ca34028118 (diff) | |
download | FreeBSD-src-7be446ee1c9d1c224ed502e2943f86134e3e174f.zip FreeBSD-src-7be446ee1c9d1c224ed502e2943f86134e3e174f.tar.gz |
fix build:
you may not use string concatination with __FUNCTION__, replace all occurances
of:
__FUNCTION__ ": error string"
with:
"%s: error string"
Diffstat (limited to 'usr.sbin/pkg_install/create')
-rw-r--r-- | usr.sbin/pkg_install/create/perform.c | 28 | ||||
-rw-r--r-- | usr.sbin/pkg_install/create/pl.c | 8 |
2 files changed, 21 insertions, 15 deletions
diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c index ca708ff..0c6ebdc 100644 --- a/usr.sbin/pkg_install/create/perform.c +++ b/usr.sbin/pkg_install/create/perform.c @@ -94,7 +94,8 @@ pkg_perform(char **pkgs) pkg_in = fopen(Contents, "r"); if (!pkg_in) { cleanup(0); - errx(2, __FUNCTION__ ": unable to open contents file '%s' for input", Contents); + errx(2, "%s: unable to open contents file '%s' for input", + __FUNCTION__, Contents); } } plist.head = plist.tail = NULL; @@ -255,12 +256,14 @@ pkg_perform(char **pkgs) fp = fopen(CONTENTS_FNAME, "w"); if (!fp) { cleanup(0); - errx(2, __FUNCTION__ ": can't open file %s for writing", CONTENTS_FNAME); + errx(2, "%s: can't open file %s for writing", + __FUNCTION__, CONTENTS_FNAME); } write_plist(&plist, fp); if (fclose(fp)) { cleanup(0); - errx(2, __FUNCTION__ ": error while closing %s", CONTENTS_FNAME); + errx(2, "%s: error while closing %s", + __FUNCTION__, CONTENTS_FNAME); } /* And stick it into a tar ball */ @@ -325,11 +328,11 @@ make_dist(const char *homedir, const char *pkg, const char *suff, Package *plist /* Set up a pipe for passing the filenames, and fork off a tar process. */ if (pipe(pipefds) == -1) { cleanup(0); - errx(2, __FUNCTION__ ": cannot create pipe"); + errx(2, "%s: cannot create pipe", __FUNCTION__); } if ((pid = fork()) == -1) { cleanup(0); - errx(2, __FUNCTION__ ": cannot fork process for tar"); + errx(2, "%s: cannot fork process for tar", __FUNCTION__); } if (pid == 0) { /* The child */ dup2(pipefds[0], 0); @@ -337,14 +340,14 @@ make_dist(const char *homedir, const char *pkg, const char *suff, Package *plist close(pipefds[1]); execv("/usr/bin/tar", (char * const *)(uintptr_t)args); cleanup(0); - errx(2, __FUNCTION__ ": failed to execute tar command"); + errx(2, "%s: failed to execute tar command", __FUNCTION__); } /* Meanwhile, back in the parent process ... */ close(pipefds[0]); if ((totar = fdopen(pipefds[1], "w")) == NULL) { cleanup(0); - errx(2, __FUNCTION__ ": fdopen failed"); + errx(2, "%s: fdopen failed", __FUNCTION__); } fprintf(totar, "%s\n", CONTENTS_FNAME); @@ -380,7 +383,7 @@ make_dist(const char *homedir, const char *pkg, const char *suff, Package *plist /* assume either signal or bad exit is enough for us */ if (ret) { cleanup(0); - errx(2, __FUNCTION__ ": tar command failed with code %d", ret); + errx(2, "%s: tar command failed with code %d", __FUNCTION__, ret); } } @@ -389,15 +392,18 @@ sanity_check() { if (!Comment) { cleanup(0); - errx(2, __FUNCTION__ ": required package comment string is missing (-c comment)"); + errx(2, "%s: required package comment string is missing (-c comment)", + __FUNCTION__); } if (!Desc) { cleanup(0); - errx(2, __FUNCTION__ ": required package description string is missing (-d desc)"); + errx(2, "%s: required package description string is missing (-d desc)", + __FUNCTION__); } if (!Contents) { cleanup(0); - errx(2, __FUNCTION__ ": required package contents list is missing (-f [-]file)"); + errx(2, "%s: required package contents list is missing (-f [-]file)", + __FUNCTION__); } } diff --git a/usr.sbin/pkg_install/create/pl.c b/usr.sbin/pkg_install/create/pl.c index eb4076b..0859e1f 100644 --- a/usr.sbin/pkg_install/create/pl.c +++ b/usr.sbin/pkg_install/create/pl.c @@ -102,7 +102,7 @@ trylink(const char *from, const char *to) strcat(where_args, "|tar xpf -"); \ if (system(where_args)) { \ cleanup(0); \ - errx(2, __FUNCTION__ ": can't invoke tar pipeline"); \ + errx(2, "%s: can't invoke tar pipeline", __FUNCTION__); \ } \ memset(where_args, 0, maxargs); \ last_chdir = NULL; \ @@ -134,7 +134,7 @@ copy_plist(const char *home, Package *plist) where_args = malloc(maxargs); if (!where_args) { cleanup(0); - errx(2, __FUNCTION__ ": can't get argument list space"); + errx(2, "%s: can't get argument list space", __FUNCTION__); } memset(where_args, 0, maxargs); @@ -203,7 +203,7 @@ copy_plist(const char *home, Package *plist) } if (add_count < 0 || add_count > maxargs - where_count) { cleanup(0); - errx(2, __FUNCTION__ ": oops, miscounted strings!"); + errx(2, "%s: oops, miscounted strings!", __FUNCTION__); } where_count += add_count; } @@ -241,7 +241,7 @@ copy_plist(const char *home, Package *plist) p->name); if (add_count < 0 || add_count > maxargs - where_count) { cleanup(0); - errx(2, __FUNCTION__ ": oops, miscounted strings!"); + errx(2, "%s: oops, miscounted strings!", __FUNCTION__); } where_count += add_count; last_chdir = (mythere ? mythere : where); |