From 7f7ace8fb2ee927060b680106bf490631ded27e7 Mon Sep 17 00:00:00 2001 From: Maxim Sobolev Date: Thu, 17 May 2001 10:12:45 +0000 Subject: [PATCH] Style policy: reformat multiline comments to conform to style(9). --- usr.sbin/pkg_install/add/perform.c | 8 +++++-- usr.sbin/pkg_install/create/perform.c | 6 +++-- usr.sbin/pkg_install/create/pl.c | 32 ++++++++++++++++++--------- usr.sbin/pkg_install/delete/perform.c | 9 +++++--- usr.sbin/pkg_install/lib/file.c | 26 +++++++++++++++------- usr.sbin/pkg_install/sign/extern.h | 9 ++++---- usr.sbin/pkg_install/sign/gzip.c | 5 +++-- usr.sbin/pkg_install/sign/gzip.h | 13 ++++++----- usr.sbin/pkg_install/sign/pgp_sign.c | 10 +++++---- usr.sbin/pkg_install/sign/sha1.c | 11 ++++----- 10 files changed, 83 insertions(+), 46 deletions(-) diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c index f53f3cd71f41..ad5e2f015344 100644 --- a/usr.sbin/pkg_install/add/perform.c +++ b/usr.sbin/pkg_install/add/perform.c @@ -117,7 +117,10 @@ pkg_do(char *pkg) fclose(cfile); } else { - strcpy(pkg_fullname, pkg); /* copy for sanity's sake, could remove pkg_fullname */ + strcpy(pkg_fullname, pkg); /* + * Copy for sanity's sake, + * could remove pkg_fullname + */ if (strcmp(pkg, "-")) { if (stat(pkg_fullname, &sb) == FAIL) { warnx("can't stat package file '%s'", pkg_fullname); @@ -324,7 +327,8 @@ pkg_do(char *pkg) } } - /* Test whether to use the old method of passing tokens to installation + /* + * Test whether to use the old method of passing tokens to installation * scripts, and set appropriate variables.. */ diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c index 8d073e45304e..0c32ea61096f 100644 --- a/usr.sbin/pkg_install/create/perform.c +++ b/usr.sbin/pkg_install/create/perform.c @@ -173,8 +173,10 @@ pkg_perform(char **pkgs) /* Make first "real contents" pass over it */ check_list(home, &plist); - (void) umask(022); /* make sure gen'ed directories, files don't have - group or other write bits. */ + (void) umask(022); /* + * Make sure gen'ed directories, files don't have + * group or other write bits. + */ /* copy_plist(home, &plist); */ /* mark_plist(&plist); */ diff --git a/usr.sbin/pkg_install/create/pl.c b/usr.sbin/pkg_install/create/pl.c index fc65560f0d9b..3684def1da57 100644 --- a/usr.sbin/pkg_install/create/pl.c +++ b/usr.sbin/pkg_install/create/pl.c @@ -116,8 +116,10 @@ copy_plist(char *home, Package *plist) dev_t curdir; maxargs = sysconf(_SC_ARG_MAX); - maxargs -= 64; /* some slop for the tar cmd text, - and sh -c */ + maxargs -= 64; /* + * Some slop for the tar cmd text, + * and sh -c + */ where_args = malloc(maxargs); if (!where_args) { cleanup(0); @@ -132,9 +134,11 @@ copy_plist(char *home, Package *plist) if (stat(".", &stb) == 0) curdir = stb.st_dev; else - curdir = (dev_t) -1; /* It's ok if this is a valid dev_t; - this is just a hint for an - optimization. */ + curdir = (dev_t) -1; /* + * It's ok if this is a valid dev_t; + * this is just a hint for an + * optimization. + */ while (p) { if (p->type == PLIST_CWD) @@ -152,11 +156,15 @@ copy_plist(char *home, Package *plist) if (fexists(fn)) { if (lstat(fn, &stb) == 0 && stb.st_dev == curdir && S_ISREG(stb.st_mode)) { - /* if we can link it to the playpen, that avoids a copy - and saves time. */ + /* + * If we can link it to the playpen, that avoids a copy + * and saves time. + */ if (p->name[0] != '/') { - /* don't link abspn stuff--it doesn't come from - local dir! */ + /* + * Don't link abspn stuff--it doesn't come from + * local dir! + */ if (trylink(fn, p->name) == 0) { p = p->next; continue; @@ -198,8 +206,10 @@ copy_plist(char *home, Package *plist) sprintf(fn, "%s/%s", mythere ? mythere : where, p->name); if (lstat(fn, &stb) == 0 && stb.st_dev == curdir && S_ISREG(stb.st_mode)) { - /* if we can link it to the playpen, that avoids a copy - and saves time. */ + /* + * If we can link it to the playpen, that avoids a copy + * and saves time. + */ if (trylink(fn, p->name) == 0) { p = p->next; continue; diff --git a/usr.sbin/pkg_install/delete/perform.c b/usr.sbin/pkg_install/delete/perform.c index 120622cef4e3..3a9ec87f6c84 100644 --- a/usr.sbin/pkg_install/delete/perform.c +++ b/usr.sbin/pkg_install/delete/perform.c @@ -178,7 +178,8 @@ pkg_do(char *pkg) } } - /* Test whether to use the old method of passing tokens to deinstallation + /* + * Test whether to use the old method of passing tokens to deinstallation * scripts, and set appropriate variables.. */ @@ -213,8 +214,10 @@ pkg_do(char *pkg) errx(2, __FUNCTION__ ": unable to return to working directory %s!", home); } - /* Some packages aren't packed right, so we need to just ignore - delete_package()'s status. Ugh! :-( */ + /* + * Some packages aren't packed right, so we need to just ignore + * delete_package()'s status. Ugh! :-( + */ if (delete_package(FALSE, CleanDirs, &Plist) == FAIL) warnx( "couldn't entirely delete package (perhaps the packing list is\n" diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c index 7817fc83f807..baf65b18f247 100644 --- a/usr.sbin/pkg_install/lib/file.c +++ b/usr.sbin/pkg_install/lib/file.c @@ -158,12 +158,17 @@ fileGetURL(char *base, char *spec) if (!isURL(spec)) { if (!base && !hint) return NULL; - /* We've been given an existing URL (that's known-good) and now we need - to construct a composite one out of that and the basename we were - handed as a dependency. */ + /* + * We've been given an existing URL (that's known-good) and now we need + * to construct a composite one out of that and the basename we were + * handed as a dependency. + */ if (base) { strcpy(fname, base); - /* Advance back two slashes to get to the root of the package hierarchy */ + /* + * Advance back two slashes to get to the root of the package + * hierarchy + */ cp = strrchr(fname, '/'); if (cp) { *cp = '\0'; /* chop name */ @@ -179,7 +184,10 @@ fileGetURL(char *base, char *spec) return NULL; } else { - /* Otherwise, we've been given an environment variable hinting at the right location from sysinstall */ + /* + * Otherwise, we've been given an environment variable hinting + * at the right location from sysinstall + */ strcpy(fname, hint); strcat(fname, spec); strcat(fname, ".tgz"); @@ -312,8 +320,9 @@ fileGetContents(char *fname) return contents; } -/* Takes a filename and package name, returning (in "try") the canonical "preserve" - * name for it. +/* + * Takes a filename and package name, returning (in "try") the + * canonical "preserve" name for it. */ Boolean make_preserve_name(char *try, int max, char *name, char *file) @@ -464,7 +473,8 @@ unpack(char *pkg, char *flist) return 0; } -/* Using fmt, replace all instances of: +/* + * Using fmt, replace all instances of: * * %F With the parameter "name" * %D With the parameter "dir" diff --git a/usr.sbin/pkg_install/sign/extern.h b/usr.sbin/pkg_install/sign/extern.h index 760d39cd3788..e7c00766f33f 100644 --- a/usr.sbin/pkg_install/sign/extern.h +++ b/usr.sbin/pkg_install/sign/extern.h @@ -29,10 +29,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* Convention: all functions that operate on a FILE * also take a filename - for diagnostic purposes. The file can be connected to a pipe, so - - don't rewind - - don't reopen from filename. +/* + * Convention: all functions that operate on a FILE * also take a filename + * for diagnostic purposes. The file can be connected to a pipe, so + * - don't rewind + * - don't reopen from filename. */ struct mygzip_header; diff --git a/usr.sbin/pkg_install/sign/gzip.c b/usr.sbin/pkg_install/sign/gzip.c index 4150bcc8ae66..89cdb9cc6787 100644 --- a/usr.sbin/pkg_install/sign/gzip.c +++ b/usr.sbin/pkg_install/sign/gzip.c @@ -38,8 +38,9 @@ #include "gzip.h" #include "pgp.h" -/* Signatures follow a simple format - (endianess was chosen to conform to gzip header format) +/* + * Signatures follow a simple format + * (endianess was chosen to conform to gzip header format) */ SIGNTAG known_tags[KNOWN_TAGS] = { diff --git a/usr.sbin/pkg_install/sign/gzip.h b/usr.sbin/pkg_install/sign/gzip.h index bc64aab1445e..238010fe7709 100644 --- a/usr.sbin/pkg_install/sign/gzip.h +++ b/usr.sbin/pkg_install/sign/gzip.h @@ -35,9 +35,10 @@ #define CONTINUATION 0x02 #define EXTRA_FIELD 0x04 -/* meaningful fields in a gzip header, see gzip proper for details. - This structure should not be fiddled with outside of gzip_read_header - and gzip_write_header +/* + * Meaningful fields in a gzip header, see gzip proper for details. + * This structure should not be fiddled with outside of gzip_read_header + * and gzip_write_header */ struct mygzip_header { char method; @@ -72,8 +73,10 @@ extern int gzip_read_header __P((FILE *f, /*@out@*/struct mygzip_header *h, \ /* gzip_write_header returns 1 for success */ extern int gzip_write_header __P((FILE *f, const struct mygzip_header *h, \ /*@null@*/struct signature *sign)); -/* writing header to memory. Returns size needed, or 0 if buffer too small - buffer must be at least 14 characters */ +/* + * Writing header to memory. Returns size needed, or 0 if buffer too small + * buffer must be at least 14 characters + */ extern int gzip_copy_header __P((const struct mygzip_header *h, \ /*@null@*/struct signature *sign, \ void (*add)(void *, const char *, size_t), void *data)); diff --git a/usr.sbin/pkg_install/sign/pgp_sign.c b/usr.sbin/pkg_install/sign/pgp_sign.c index 1fada956f2de..a9bd7956f7d5 100644 --- a/usr.sbin/pkg_install/sign/pgp_sign.c +++ b/usr.sbin/pkg_install/sign/pgp_sign.c @@ -235,8 +235,9 @@ return; /* Retrieve the pgp passphrase */ p = getpass("Enter passphrase:"); - /* somewhat kludgy code to get the passphrase to pgp, see - pgp documentation for the gore + /* + * Somewhat kludgy code to get the passphrase to pgp, see + * pgp documentation for the gore */ if (pipe(fd) != 0) { perror("pkg_sign"); @@ -249,8 +250,9 @@ return; case 0: { (void)close(fd[0]); - /* the child fills the pipe with copies of the passphrase. - Expect violent death when father exits. + /* + * The child fills the pipe with copies of the passphrase. + * Expect violent death when father exits. */ printf("Child process %d stuffing passphrase in pipe:\n", getpid()); for(;;) { diff --git a/usr.sbin/pkg_install/sign/sha1.c b/usr.sbin/pkg_install/sign/sha1.c index c16eb028084b..a8a23ceaec5c 100644 --- a/usr.sbin/pkg_install/sign/sha1.c +++ b/usr.sbin/pkg_install/sign/sha1.c @@ -50,11 +50,12 @@ struct sha1_checker { #define SHA1_TEMPLATE "SHA1 (%s) = " #define BUFSIZE (MAXID+sizeof(SHA1_TEMPLATE)+2*SHA_DIGEST_LENGTH+1) -/* Finalize SHA1 checksum for our sha1_context into result - (size at least BUFSIZE). Returns the length of the checksum - marker, e.g., SHA1 (id) = xxxxxxxxx - ^here - Return 0 for errors. +/* + * Finalize SHA1 checksum for our sha1_context into result + * (size at least BUFSIZE). Returns the length of the checksum + * marker, e.g., SHA1 (id) = xxxxxxxxx + * ^here + * Return 0 for errors. */ size_t sha1_build_checksum(result, n)