From owner-p4-projects@FreeBSD.ORG Tue Jun 1 00:24:36 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DDED21065674; Tue, 1 Jun 2010 00:24:35 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89835106567E for ; Tue, 1 Jun 2010 00:24:35 +0000 (UTC) (envelope-from jlaffaye@FreeBSD.org) Received: from repoman.freebsd.org (unknown [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 76E148FC0A for ; Tue, 1 Jun 2010 00:24:35 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o510OZJL064660 for ; Tue, 1 Jun 2010 00:24:35 GMT (envelope-from jlaffaye@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o510OZsL064658 for perforce@freebsd.org; Tue, 1 Jun 2010 00:24:35 GMT (envelope-from jlaffaye@FreeBSD.org) Date: Tue, 1 Jun 2010 00:24:35 GMT Message-Id: <201006010024.o510OZsL064658@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jlaffaye@FreeBSD.org using -f From: Julien Laffaye To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 179028 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 00:24:36 -0000 http://p4web.freebsd.org/@@179028?ac=10 Change 179028 by jlaffaye@gsoc on 2010/06/01 00:24:08 Integrate from gcooper's branch. Affected files ... .. //depot/projects/soc2010/pkg_complete/lib/libpkg/file.c#2 integrate .. //depot/projects/soc2010/pkg_complete/lib/libpkg/global.c#2 integrate .. //depot/projects/soc2010/pkg_complete/lib/libpkg/match.c#2 integrate .. //depot/projects/soc2010/pkg_complete/lib/libpkg/pen.c#2 integrate .. //depot/projects/soc2010/pkg_complete/lib/libpkg/pkg.h#2 integrate .. //depot/projects/soc2010/pkg_complete/lib/libpkg/plist.c#2 integrate .. //depot/projects/soc2010/pkg_complete/lib/libpkg/url.c#2 integrate .. //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/perform.c#2 integrate .. //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/create/perform.c#2 integrate .. //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/delete/perform.c#2 integrate .. //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/info/perform.c#2 integrate Differences ... ==== //depot/projects/soc2010/pkg_complete/lib/libpkg/file.c#2 (text+ko) ==== @@ -269,32 +269,29 @@ * Return the number of bytes successfully written out to str or -1 on * failure. */ -size_t +off_t write_file(const char *name, const char *str) { - FILE *fp = NULL; + int fd = -1; + int serrno; off_t written_len = -1; size_t len; - int serrno; errno = 0; - fp = fopen(name, "w"); - if (fp != NULL) { + len = strlen(str); - len = strlen(str); - written_len = fwrite(str, 1, len, fp); + if ((fd = open(name, O_WRONLY | O_CREAT)) != -1) { - if (fp != NULL) { - serrno = errno; - (void) fclose(fp); - if (serrno != 0) - errno = serrno; - } + written_len = write(fd, str, len); + serrno = errno; + (void) close(fd); + if (serrno != 0) + errno = serrno; } - return (size_t) (errno == 0 && written_len > 0 ? written_len : -1); + return (off_t) (errno == 0 && written_len > 0 ? written_len : -1); } @@ -335,10 +332,8 @@ ARCHIVE_EXTRACT_FFLAGS|ARCHIVE_EXTRACT_XATTR) /* - * Unpack a single file, denoted by file, to a buffer; this call uses - * unpack_to_fd to first open the file, and once that has been completed - * it opens the file and proceeds to read it into the buffer which will - * need to be freed by the user at a later date. + * Unpack a single file, denoted by file, to a buffer. It proceeds to read it + * into the buffer which will need to be freed by the user at a later date. * * Returns an address to a buffer with the contents of *file if successful, or * returns NULL on failure. @@ -347,41 +342,100 @@ unpack_to_buffer(const char *pkg, const char *file) { - struct stat sb; + struct archive *archive; + struct archive_entry *archive_entry; + Boolean found_match = FALSE; + + int64_t buf_size; + char *buf = NULL; - int fd; - int serrno; + const char *entry_pathname = NULL; + const char *error = NULL; + int archive_fd = -1; + int r; + + errno = 0; + + if ((archive = archive_read_new()) != NULL) { + + if (archive_read_support_compression_all(archive) + != ARCHIVE_OK || + archive_read_support_format_tar(archive) != ARCHIVE_OK) + error = archive_error_string(archive); + /* + * Avoid potential race conditions with + * archive_read_open_filename(3), by opening the file + * beforehand. + */ + else if (pkg == NULL) + archive_fd = fileno(stdin); + else + archive_fd = open(pkg, O_RDONLY); + + } + + /* The initial open failed or archive(3) failed to open the file. */ + if (archive_fd == -1 || archive == NULL) ; + /* archive(3) failed to open the file descriptor. */ + else if (archive_read_open_fd(archive, archive_fd, + ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) + error = archive_error_string(archive); + else + while (error == NULL && found_match == FALSE && + (r = archive_read_next_header(archive, &archive_entry)) == + ARCHIVE_OK) { + + entry_pathname = archive_entry_pathname(archive_entry); + + if (strncmp(file, entry_pathname, PATH_MAX) == 0) { + + /* + * Regardless of whether or not extract passes, + * we found our target file so let's exit + * quickly because the underlying issue is most + * likely unrecoverable. + */ + found_match = TRUE; + + buf_size = archive_entry_size(archive_entry); + + if (buf_size == 0) + errno = EINVAL; + else { + + buf = malloc(sizeof(char)*buf_size); + + if (buf == NULL) + error = strerror(errno); + else { - if ((fd = unpack_to_fd(pkg, file)) != -1) { + r = archive_read_data(archive, + buf, buf_size); - if (fstat(fd, &sb) == 0) { + if (r != ARCHIVE_OK) + error = archive_error_string(archive); - /* - * User either passed in a non-NULL value or we need - * to malloc on the fly and let the user deal with it - * later. - */ - buf = malloc(sb.st_size); - if (buf != NULL) { + } - if (read(fd, buf, sb.st_size) != sb.st_size) { - free(buf); - buf = NULL; } } } - } + +#if 0 + /* + * This should be stored in a global buffer or something similar that's + * retrievable via pkg_error or something of that flavor. + */ + if (errno != 0) + error = strerror(errno); +#endif - if (0 <= fd) { - serrno = errno; - close(fd); - if (serrno != 0) - errno = serrno; - } + if (archive != NULL) + archive_read_finish(archive); - return buf; + return (buf); } @@ -402,7 +456,8 @@ Boolean extract_whole_archive = FALSE; const char *entry_pathname = NULL; const char *error = NULL; - int archive_fd = -1, r; + int archive_fd = -1; + int r; errno = 0; @@ -490,9 +545,8 @@ const char *entry_pathname = NULL; const char *error = NULL; + int archive_fd = -1, r; int fd = -1; - /* int fd = -1; */ - int archive_fd = -1, r; errno = 0; @@ -563,7 +617,7 @@ if (0 <= archive_fd) close(archive_fd); - return fd; + return (fd); } ==== //depot/projects/soc2010/pkg_complete/lib/libpkg/global.c#2 (text+ko) ==== @@ -28,4 +28,4 @@ Boolean Quiet = FALSE; Boolean Fake = FALSE; Boolean Force = FALSE; -int Verbose = 0; /* Allow multiple levels of verbose. */ +int Verbose = 0; /* Allow multiple levels of verbose. */ ==== //depot/projects/soc2010/pkg_complete/lib/libpkg/match.c#2 (text+ko) ==== @@ -57,136 +57,154 @@ char ** matchinstalled(match_t MatchType, char **patterns, int *retval) { - int i, errcode, len; - char *matched; - const char *paths[2] = {LOG_DIR, NULL}; - static struct store *store = NULL; - FTS *ftsp; - FTSENT *f; - Boolean *lmatched = NULL; + static struct store *store = NULL; + FTS *ftsp; + FTSENT *f; + char *matched; + const char *paths[2] = {LOG_DIR, NULL}; + int i; + int errcode; + int len; + Boolean *lmatched = NULL; + + store = storecreate(store); + if (store == NULL) { + if (retval != NULL) + *retval = 1; + return (NULL); + } - store = storecreate(store); - if (store == NULL) { if (retval != NULL) - *retval = 1; - return NULL; - } + *retval = 0; + + if (!isdir(paths[0])) { + if (retval != NULL) + *retval = 1; + return (NULL); + } + + /* Count number of patterns */ + if (patterns != NULL) { - if (retval != NULL) - *retval = 0; + for (len = 0; patterns[len]; len++) ; - if (!isdir(paths[0])) { - if (retval != NULL) - *retval = 1; - return NULL; - /* Not reached */ - } + lmatched = alloca(sizeof(*lmatched) * len); + if (lmatched == NULL) { + warn("%s(): alloca() failed", __func__); + if (retval != NULL) + *retval = 1; + return (NULL); + } - /* Count number of patterns */ - if (patterns != NULL) { - for (len = 0; patterns[len]; len++) {} - lmatched = alloca(sizeof(*lmatched) * len); - if (lmatched == NULL) { - warnx("%s(): alloca() failed", __func__); - if (retval != NULL) - *retval = 1; - return NULL; - } - } else - len = 0; + } else + len = 0; - for (i = 0; i < len; i++) - lmatched[i] = FALSE; + for (i = 0; i < len; i++) + lmatched[i] = FALSE; + + ftsp = fts_open((char * const *)(uintptr_t)paths, + FTS_LOGICAL | FTS_NOCHDIR | FTS_NOSTAT, fname_cmp); + + if (ftsp != NULL) { + + while ((f = fts_read(ftsp)) != NULL) { + + if (f->fts_info == FTS_D && f->fts_level == 1) { + + fts_set(ftsp, f, FTS_SKIP); + matched = NULL; + errcode = 0; + + if (MatchType == MATCH_ALL) + matched = f->fts_name; + else + for (i = 0; patterns[i]; i++) { + errcode = pattern_match( + MatchType, patterns[i], + f->fts_name); + if (errcode == 1) { + matched = f->fts_name; + lmatched[i] = TRUE; + errcode = 0; + } + if (matched != NULL || + errcode != 0) + break; + } + + if (errcode == 0 && matched != NULL) + errcode = storeappend(store, matched); + if (errcode != 0) { + if (retval != NULL) + *retval = 1; + return (NULL); + } - ftsp = fts_open((char * const *)(uintptr_t)paths, FTS_LOGICAL | FTS_NOCHDIR | FTS_NOSTAT, fname_cmp); - if (ftsp != NULL) { - while ((f = fts_read(ftsp)) != NULL) { - if (f->fts_info == FTS_D && f->fts_level == 1) { - fts_set(ftsp, f, FTS_SKIP); - matched = NULL; - errcode = 0; - if (MatchType == MATCH_ALL) - matched = f->fts_name; - else - for (i = 0; patterns[i]; i++) { - errcode = pattern_match(MatchType, patterns[i], f->fts_name); - if (errcode == 1) { - matched = f->fts_name; - lmatched[i] = TRUE; - errcode = 0; } - if (matched != NULL || errcode != 0) - break; - } - if (errcode == 0 && matched != NULL) - errcode = storeappend(store, matched); - if (errcode != 0) { - if (retval != NULL) - *retval = 1; - return NULL; - /* Not reached */ + } - } + + fts_close(ftsp); + } - fts_close(ftsp); - } - if (MatchType == MATCH_GLOB) { - for (i = 0; i < len; i++) - if (lmatched[i] == FALSE) - storeappend(store, patterns[i]); - } + /* XXX (gcooper): check for return code from storeappend here? */ + if (MatchType == MATCH_GLOB) + for (i = 0; i < len; i++) + if (lmatched[i] == FALSE) + storeappend(store, patterns[i]); - if (store->used == 0) - return NULL; - else - return store->store; + if (store->used == 0) + return (NULL); + else + return (store->store); } int pattern_match(match_t MatchType, char *pattern, const char *pkgname) { - int errcode = 0; - const char *fname = pkgname; - char basefname[PATH_MAX]; - char condchar = '\0'; - char *condition; + char basefname[PATH_MAX]; + char condchar = '\0'; + char *condition; + const char *ch; + const char *fname = pkgname; + int errcode = 0; - /* do we have an appended condition? */ - condition = strpbrk(pattern, "<>="); - if (condition) { - const char *ch; - /* yes, isolate the pattern from the condition ... */ - if (condition > pattern && condition[-1] == '!') - condition--; - condchar = *condition; - *condition = '\0'; - /* ... and compare the name without version */ - ch = strrchr(fname, '-'); - if (ch && ch - fname < PATH_MAX) { - strlcpy(basefname, fname, ch - fname + 1); - fname = basefname; + /* do we have an appended condition? */ + condition = strpbrk(pattern, "<>="); + if (condition) { + /* yes, isolate the pattern from the condition ... */ + if (condition > pattern && condition[-1] == '!') + condition--; + condchar = *condition; + *condition = '\0'; + /* ... and compare the name without version */ + ch = strrchr(fname, '-'); + if (ch != NULL && ch - fname < PATH_MAX) { + strlcpy(basefname, fname, ch - fname + 1); + fname = basefname; + } } - } - switch (MatchType) { - case MATCH_EREGEX: - case MATCH_REGEX: - errcode = rex_match(pattern, fname, MatchType == MATCH_EREGEX ? 1 : 0); - break; - case MATCH_NGLOB: - case MATCH_GLOB: - errcode = (csh_match(pattern, fname, 0) == 0) ? 1 : 0; - break; - case MATCH_EXACT: - errcode = (strcmp(pattern, fname) == 0) ? 1 : 0; - break; - case MATCH_ALL: - errcode = 1; - break; - default: - break; - } + switch (MatchType) { + case MATCH_EREGEX: + case MATCH_REGEX: + errcode = rex_match(pattern, fname, + MatchType == MATCH_EREGEX ? 1 : 0); + break; + case MATCH_NGLOB: + case MATCH_GLOB: + errcode = (csh_match(pattern, fname, 0) == 0) ? 1 : 0; + break; + case MATCH_EXACT: + errcode = (strcmp(pattern, fname) == 0) ? 1 : 0; + break; + case MATCH_ALL: + errcode = 1; + break; + default: + break; + } /* loop over all appended conditions */ while (condition) { @@ -366,53 +384,53 @@ int isinstalledpkg(const char *name) { - int result; - char *buf, *buf2; - struct iip_memo *memo; + struct iip_memo *memo; + int result; + char *buf, *buf2; + + LIST_FOREACH(memo, &iip_memo, iip_link) { + if (strcmp(memo->iip_name, name) == 0) + return (memo->iip_result); + } - LIST_FOREACH(memo, &iip_memo, iip_link) { - if (strcmp(memo->iip_name, name) == 0) - return memo->iip_result; - } - - buf2 = NULL; - asprintf(&buf, "%s/%s", LOG_DIR, name); - if (buf == NULL) - goto errout; - if (!isdir(buf) || access(buf, R_OK) == -1) { - result = 0; - } else { - asprintf(&buf2, "%s/%s", buf, CONTENTS_FNAME); - if (buf2 == NULL) - goto errout; + buf2 = NULL; + asprintf(&buf, "%s/%s", LOG_DIR, name); + if (buf == NULL) + goto errout; + if (!isdir(buf) || access(buf, R_OK) == -1) + result = 0; + else { + asprintf(&buf2, "%s/%s", buf, CONTENTS_FNAME); + if (buf2 == NULL) + goto errout; - if (!isfile(buf2) || access(buf2, R_OK) == -1) - result = -1; - else - result = 1; - } + if (!isfile(buf2) || access(buf2, R_OK) == -1) + result = -1; + else + result = 1; + } - free(buf); - buf = strdup(name); - if (buf == NULL) - goto errout; - free(buf2); - buf2 = NULL; + free(buf); + buf = strdup(name); + if (buf == NULL) + goto errout; + free(buf2); + buf2 = NULL; - memo = malloc(sizeof *memo); - if (memo == NULL) - goto errout; - memo->iip_name = buf; - memo->iip_result = result; - LIST_INSERT_HEAD(&iip_memo, memo, iip_link); - return result; + memo = malloc(sizeof *memo); + if (memo == NULL) + goto errout; + memo->iip_name = buf; + memo->iip_result = result; + LIST_INSERT_HEAD(&iip_memo, memo, iip_link); + return (result); errout: - if (buf != NULL) - free(buf); - if (buf2 != NULL) - free(buf2); - return -1; + if (buf != NULL) + free(buf); + if (buf2 != NULL) + free(buf2); + return (-1); } /* @@ -423,28 +441,30 @@ static int rex_match(const char *pattern, const char *pkgname, int extended) { - char errbuf[128]; - int errcode; - int retval; - regex_t rex; + char errbuf[128]; + int errcode; + int retval; + regex_t rex; + + retval = 0; - retval = 0; + errcode = regcomp(&rex, pattern, + (extended ? REG_EXTENDED : REG_BASIC) | REG_NOSUB); + if (errcode == 0) + errcode = regexec(&rex, pkgname, 0, NULL, 0); - errcode = regcomp(&rex, pattern, (extended ? REG_EXTENDED : REG_BASIC) | REG_NOSUB); - if (errcode == 0) - errcode = regexec(&rex, pkgname, 0, NULL, 0); + if (errcode == 0) + retval = 1; + else if (errcode != REG_NOMATCH) { + regerror(errcode, &rex, errbuf, sizeof(errbuf)); + warnx("%s: %s", pattern, errbuf); + retval = -1; + } - if (errcode == 0) { - retval = 1; - } else if (errcode != REG_NOMATCH) { - regerror(errcode, &rex, errbuf, sizeof(errbuf)); - warnx("%s: %s", pattern, errbuf); - retval = -1; - } + regfree(&rex); - regfree(&rex); + return (retval); - return retval; } /* @@ -455,89 +475,106 @@ static int csh_match(const char *pattern, const char *string, int flags) { - int ret = FNM_NOMATCH; + + Boolean quoted; + + const char *current = NULL; + const char *eb; + const char *nextchoice = pattern; + const char *pos; + const char *postfix; + char buf[FILENAME_MAX]; + + int prefixlen = -1; + int currentlen = 0; + int level = 0; + int ret = FNM_NOMATCH; + + do { + + pos = nextchoice; + postfix = NULL; + + quoted = FALSE; + + nextchoice = NULL; + + do { + + if (*pos == '\0') + postfix = pos; + else if (quoted == TRUE) + quoted = FALSE; + else { + + switch (*pos) { + case '{': + ++level; + if (level == 1) { + current = pos + 1; + prefixlen = pos - pattern; + } + break; + case ',': + if (level == 1 && !nextchoice) { + nextchoice = pos + 1; + currentlen = pos - current; + } + break; + case '}': + if (level == 1) { + postfix = pos+1; + if (!nextchoice) { + currentlen = + pos - current; + } + } + level--; + break; + case '[': + eb = pos + 1; + if (*eb == '!' || *eb == '^') + eb++; + if (*eb == ']') + eb++; + while (*eb && *eb != ']') + eb++; + if (*eb) + pos = eb; + break; + case '\\': + quoted = TRUE; + break; + default: + break; + } + + } + pos++; - const char *nextchoice = pattern; - const char *current = NULL; + } while (postfix == NULL); - int prefixlen = -1; - int currentlen = 0; + if (current) { - int level = 0; + snprintf(buf, sizeof(buf), "%.*s%.*s%s", + prefixlen, pattern, currentlen, current, postfix); - do { - const char *pos = nextchoice; - const char *postfix = NULL; + ret = csh_match(buf, string, flags); - Boolean quoted = FALSE; + if (ret) { + current = nextchoice; + level = 1; + } else + current = NULL; - nextchoice = NULL; + } else + ret = fnmatch(pattern, string, flags); - do { - const char *eb; - if (!*pos) { - postfix = pos; - } else if (quoted) { - quoted = FALSE; - } else { - switch (*pos) { - case '{': - ++level; - if (level == 1) { - current = pos+1; - prefixlen = pos-pattern; - } - break; - case ',': - if (level == 1 && !nextchoice) { - nextchoice = pos+1; - currentlen = pos-current; - } - break; - case '}': - if (level == 1) { - postfix = pos+1; - if (!nextchoice) - currentlen = pos-current; - } - level--; - break; - case '[': - eb = pos+1; - if (*eb == '!' || *eb == '^') - eb++; - if (*eb == ']') - eb++; - while(*eb && *eb != ']') - eb++; - if (*eb) - pos=eb; - break; - case '\\': - quoted = TRUE; - break; - default: - ; - } - } - pos++; - } while (!postfix); + } while (current); - if (current) { - char buf[FILENAME_MAX]; - snprintf(buf, sizeof(buf), "%.*s%.*s%s", prefixlen, pattern, currentlen, current, postfix); - ret = csh_match(buf, string, flags); - if (ret) { - current = nextchoice; - level = 1; - } else - current = NULL; - } else - ret = fnmatch(pattern, string, flags); - } while (current); + return (ret); - return ret; } /* @@ -547,57 +584,74 @@ struct store * storecreate(struct store *store) { - int i; + int i; - if (store == NULL) { - store = malloc(sizeof *store); if (store == NULL) { - warnx("%s(): malloc() failed", __func__); - return NULL; + store = malloc(sizeof *store); + if (store == NULL) { + warn("%s(): malloc() failed", __func__); + return (NULL); + } + store->currlen = 0; + store->store = NULL; + } else if (store->store != NULL) { + /* Free previously allocated memory */ + for (i = 0; store->store[i] != NULL; i++) + free(store->store[i]); + store->store[0] = NULL; } - store->currlen = 0; - store->store = NULL; - } else if (store->store != NULL) { - /* Free previously allocated memory */ - for (i = 0; store->store[i] != NULL; i++) - free(store->store[i]); - store->store[0] = NULL; - } - store->used = 0; + store->used = 0; - return store; + return (store); } /* * Append specified element to the provided store. + * + * Return 0 on success, return 1 on error. */ static int storeappend(struct store *store, const char *item) { - if (store->used + 2 > store->currlen) { - store->currlen += 16; - store->store = reallocf(store->store, - store->currlen * sizeof(*(store->store))); - if (store->store == NULL) { - store->currlen = 0; - warnx("%s(): reallocf() failed", __func__); - return 1; + int retcode = 0; + + if (store->used + 2 > store->currlen) { + + store->currlen += 16; + store->store = reallocf(store->store, + store->currlen * sizeof(*(store->store))); + + if (store->store == NULL) { + store->currlen = 0; + warn("%s(): reallocf() failed", __func__); + retcode = -1; + } + + } + + if (retcode == 0) { + + asprintf(&(store->store[store->used]), "%s", item); + /* + * XXX (gcooper): should the entire store be invalidated here, + * i.e. free store->store? + */ + if (store->store[store->used] == NULL) { + warn("%s(): malloc() failed", __func__); + retcode = -1; + } else { + store->used++; + store->store[store->used] = NULL; + } + } - } - asprintf(&(store->store[store->used]), "%s", item); - if (store->store[store->used] == NULL) { - warnx("%s(): malloc() failed", __func__); - return 1; - } - store->used++; - store->store[store->used] = NULL; + return (retcode); - return 0; } static int fname_cmp(const FTSENT * const *a, const FTSENT * const *b) { - return strcmp((*a)->fts_name, (*b)->fts_name); + return (strcmp((*a)->fts_name, (*b)->fts_name)); } ==== //depot/projects/soc2010/pkg_complete/lib/libpkg/pen.c#2 (text+ko) ==== @@ -37,7 +37,7 @@ char * where_playpen(void) { - return PenLocation; + return (PenLocation); } /* Find a good place to play. */ @@ -49,7 +49,7 @@ if (pen[0] != '\0' && isdir(dirname(pen)) == TRUE && (min_free(dirname(pen)) >= sz)) - return pen; + return (pen); else if ((cp = getenv("PKG_TMPDIR")) != NULL && stat(cp, &sb) == 0 && (min_free(cp) >= sz)) sprintf(pen, "%s/instmp.XXXXXX", cp); @@ -65,9 +65,9 @@ strcpy(pen, "/usr/tmp/instmp.XXXXXX"); else { errno = ENOSPC; - return NULL; + return (NULL); } - return pen; + return (pen); } #define MAX_STACK 20 @@ -81,7 +81,7 @@ errx(2, "%s: stack overflow.\n", __func__); pstack[pdepth] = strdup(pen); - return pstack[pdepth]; + return (pstack[pdepth]); } static void @@ -118,7 +118,7 @@ } - return pen_location; + return (pen_location); } @@ -155,7 +155,7 @@ } - return rc; + return (rc); } >>> TRUNCATED FOR MAIL (1000 lines) <<<