PERFORCE change 130907 for review
Marcel Moolenaar
marcel at FreeBSD.org
Fri Dec 14 15:20:05 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=130907
Change 130907 by marcel at marcel_cluster on 2007/12/14 23:19:29
IFC @130905
Affected files ...
.. //depot/projects/e500/games/fortune/datfiles/fortunes#7 integrate
.. //depot/projects/e500/games/fortune/datfiles/fortunes-o.real#4 integrate
.. //depot/projects/e500/include/pthread_np.h#3 integrate
.. //depot/projects/e500/lib/libc/Versions.def#2 integrate
.. //depot/projects/e500/lib/libfetch/Makefile#4 integrate
.. //depot/projects/e500/lib/libfetch/common.c#2 integrate
.. //depot/projects/e500/lib/libfetch/common.h#2 integrate
.. //depot/projects/e500/lib/libfetch/fetch.c#2 integrate
.. //depot/projects/e500/lib/libfetch/file.c#2 integrate
.. //depot/projects/e500/lib/libfetch/ftp.c#2 integrate
.. //depot/projects/e500/lib/libfetch/http.c#3 integrate
.. //depot/projects/e500/lib/libthr/pthread.map#4 integrate
.. //depot/projects/e500/lib/libthr/thread/thr_mutex.c#4 integrate
.. //depot/projects/e500/lib/libthr/thread/thr_private.h#4 integrate
.. //depot/projects/e500/lib/msun/Symbol.map#2 integrate
.. //depot/projects/e500/lib/msun/man/sqrt.3#2 integrate
.. //depot/projects/e500/sbin/natd/natd.8#3 integrate
.. //depot/projects/e500/sys/conf/files.powerpc#8 integrate
.. //depot/projects/e500/sys/dev/sound/pci/maestro.c#3 integrate
.. //depot/projects/e500/sys/kern/Makefile#3 integrate
.. //depot/projects/e500/sys/powerpc/aim/clock.c#5 integrate
.. //depot/projects/e500/sys/powerpc/aim/copyinout.c#3 integrate
.. //depot/projects/e500/sys/powerpc/aim/interrupt.c#4 integrate
.. //depot/projects/e500/sys/powerpc/aim/locore.S#3 integrate
.. //depot/projects/e500/sys/powerpc/aim/machdep.c#5 integrate
.. //depot/projects/e500/sys/powerpc/aim/mmu_oea.c#2 integrate
.. //depot/projects/e500/sys/powerpc/aim/nexus.c#4 integrate
.. //depot/projects/e500/sys/powerpc/aim/ofw_machdep.c#4 integrate
.. //depot/projects/e500/sys/powerpc/aim/ofwmagic.S#2 integrate
.. //depot/projects/e500/sys/powerpc/aim/swtch.S#3 integrate
.. //depot/projects/e500/sys/powerpc/aim/trap.c#6 integrate
.. //depot/projects/e500/sys/powerpc/aim/trap_subr.S#3 integrate
.. //depot/projects/e500/sys/powerpc/aim/uio_machdep.c#4 integrate
.. //depot/projects/e500/sys/powerpc/aim/uma_machdep.c#3 integrate
.. //depot/projects/e500/sys/powerpc/aim/vm_machdep.c#7 integrate
.. //depot/projects/e500/sys/sys/kerneldump.h#2 integrate
.. //depot/projects/e500/sys/sys/pcpu.h#4 integrate
.. //depot/projects/e500/usr.bin/xinstall/xinstall.c#2 integrate
Differences ...
==== //depot/projects/e500/games/fortune/datfiles/fortunes#7 (text+ko) ====
@@ -1,5 +1,5 @@
This fortune brought to you by:
-$FreeBSD: src/games/fortune/datfiles/fortunes,v 1.249 2007/12/09 01:00:11 dougb Exp $
+$FreeBSD: src/games/fortune/datfiles/fortunes,v 1.250 2007/12/14 01:47:11 wes Exp $
%
=======================================================================
|| ||
@@ -56259,6 +56259,9 @@
%
Where am I? Who am I? Am I? I
%
+Where am I, and what am I doing in this handbasket?
+ -- Mark A. Matthews, to Wes Peters, circa 1996
+%
Where are the calculations that go with a calculated risk?
%
WHERE CAN THE MATTER BE
==== //depot/projects/e500/games/fortune/datfiles/fortunes-o.real#4 (text+ko) ====
@@ -1,4 +1,4 @@
-%% $FreeBSD: src/games/fortune/datfiles/fortunes-o.real,v 1.28 2007/12/09 01:00:11 dougb Exp $
+%% $FreeBSD: src/games/fortune/datfiles/fortunes-o.real,v 1.29 2007/12/14 21:58:58 des Exp $
%
PLAYGIRL, Inc.
Philadelphia, Pa. 19369
@@ -755,7 +755,7 @@
"What is amiss, my friend?" asked the king.
"My lord," gasped Lancelot, "you have given me the wrong key!"
%
- "Before we get married," said the young woman to her fiancee,
+ "Before we get married," said the young woman to her fiance,
"I want to confess some affairs that I've had in the past."
"But you told me all about those a few weeks ago," her young man
replied.
==== //depot/projects/e500/include/pthread_np.h#3 (text+ko) ====
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/include/pthread_np.h,v 1.17 2007/10/29 00:31:54 imp Exp $
+ * $FreeBSD: src/include/pthread_np.h,v 1.18 2007/12/14 06:25:56 davidxu Exp $
*/
#ifndef _PTHREAD_NP_H_
#define _PTHREAD_NP_H_
@@ -49,6 +49,10 @@
void pthread_resume_all_np(void);
int pthread_resume_np(pthread_t);
void pthread_set_name_np(pthread_t, const char *);
+int pthread_mutex_getspinloops_np(pthread_mutex_t *mutex, int *count);
+int pthread_mutex_setspinloops_np(pthread_mutex_t *mutex, int count);
+int pthread_mutex_getyieldloops_np(pthread_mutex_t *mutex, int *count);
+int pthread_mutex_setyieldloops_np(pthread_mutex_t *mutex, int count);
int pthread_single_np(void);
void pthread_suspend_all_np(void);
int pthread_suspend_np(pthread_t);
==== //depot/projects/e500/lib/libc/Versions.def#2 (text) ====
@@ -1,9 +1,14 @@
-# $FreeBSD: src/lib/libc/Versions.def,v 1.3 2007/04/29 16:14:17 kan Exp $
+# $FreeBSD: src/lib/libc/Versions.def,v 1.4 2007/12/14 20:49:06 deischen Exp $
# This is our first version; it depends on no other.
+# This version was first added to 7.0-current.
FBSD_1.0 {
};
+# This version was first added to 8.0-current.
+FBSD_1.1 {
+} FBSD_1.0;
+
# This is our private namespace. Any global interfaces that are
# strictly for use only by other FreeBSD applications and libraries
# are listed here. We use a separate namespace so we can write
==== //depot/projects/e500/lib/libfetch/Makefile#4 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/lib/libfetch/Makefile,v 1.49 2007/05/24 20:28:14 des Exp $
+# $FreeBSD: src/lib/libfetch/Makefile,v 1.50 2007/12/14 10:26:58 des Exp $
.include <bsd.own.mk>
@@ -28,7 +28,7 @@
SHLIB_MAJOR= 5
ftperr.h: ftp.errors
- @echo "static struct fetcherr _ftp_errlist[] = {" > ${.TARGET}
+ @echo "static struct fetcherr ftp_errlist[] = {" > ${.TARGET}
@cat ${.ALLSRC} \
| grep -v ^# \
| sort \
@@ -39,7 +39,7 @@
@echo "};" >> ${.TARGET}
httperr.h: http.errors
- @echo "static struct fetcherr _http_errlist[] = {" > ${.TARGET}
+ @echo "static struct fetcherr http_errlist[] = {" > ${.TARGET}
@cat ${.ALLSRC} \
| grep -v ^# \
| sort \
==== //depot/projects/e500/lib/libfetch/common.c#2 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libfetch/common.c,v 1.50 2005/02/16 12:46:46 des Exp $");
+__FBSDID("$FreeBSD: src/lib/libfetch/common.c,v 1.51 2007/12/14 10:26:58 des Exp $");
#include <sys/param.h>
#include <sys/socket.h>
@@ -53,7 +53,7 @@
/*
* Error messages for resolver errors
*/
-static struct fetcherr _netdb_errlist[] = {
+static struct fetcherr netdb_errlist[] = {
#ifdef EAI_NODATA
{ EAI_NODATA, FETCH_RESOLV, "Host not found" },
#endif
@@ -73,7 +73,7 @@
* Map error code to string
*/
static struct fetcherr *
-_fetch_finderr(struct fetcherr *p, int e)
+fetch_finderr(struct fetcherr *p, int e)
{
while (p->num != -1 && p->num != e)
p++;
@@ -84,9 +84,9 @@
* Set error code
*/
void
-_fetch_seterr(struct fetcherr *p, int e)
+fetch_seterr(struct fetcherr *p, int e)
{
- p = _fetch_finderr(p, e);
+ p = fetch_finderr(p, e);
fetchLastErrCode = p->cat;
snprintf(fetchLastErrString, MAXERRSTRING, "%s", p->string);
}
@@ -95,7 +95,7 @@
* Set error code according to errno
*/
void
-_fetch_syserr(void)
+fetch_syserr(void)
{
switch (errno) {
case 0:
@@ -155,7 +155,7 @@
* Emit status message
*/
void
-_fetch_info(const char *fmt, ...)
+fetch_info(const char *fmt, ...)
{
va_list ap;
@@ -172,7 +172,7 @@
* Return the default port for a scheme
*/
int
-_fetch_default_port(const char *scheme)
+fetch_default_port(const char *scheme)
{
struct servent *se;
@@ -189,7 +189,7 @@
* Return the default proxy port for a scheme
*/
int
-_fetch_default_proxy_port(const char *scheme)
+fetch_default_proxy_port(const char *scheme)
{
if (strcasecmp(scheme, SCHEME_FTP) == 0)
return (FTP_DEFAULT_PROXY_PORT);
@@ -203,7 +203,7 @@
* Create a connection for an existing descriptor.
*/
conn_t *
-_fetch_reopen(int sd)
+fetch_reopen(int sd)
{
conn_t *conn;
@@ -220,7 +220,7 @@
* Bump a connection's reference count.
*/
conn_t *
-_fetch_ref(conn_t *conn)
+fetch_ref(conn_t *conn)
{
++conn->ref;
@@ -232,7 +232,7 @@
* Bind a socket to a specific local address
*/
int
-_fetch_bind(int sd, int af, const char *addr)
+fetch_bind(int sd, int af, const char *addr)
{
struct addrinfo hints, *res, *res0;
int err;
@@ -254,7 +254,7 @@
* Establish a TCP connection to the specified port on the specified host.
*/
conn_t *
-_fetch_connect(const char *host, int port, int af, int verbose)
+fetch_connect(const char *host, int port, int af, int verbose)
{
conn_t *conn;
char pbuf[10];
@@ -265,7 +265,7 @@
DEBUG(fprintf(stderr, "---> %s:%d\n", host, port));
if (verbose)
- _fetch_info("looking up %s", host);
+ fetch_info("looking up %s", host);
/* look up host name and set up socket address structure */
snprintf(pbuf, sizeof(pbuf), "%d", port);
@@ -274,13 +274,13 @@
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = 0;
if ((err = getaddrinfo(host, pbuf, &hints, &res0)) != 0) {
- _netdb_seterr(err);
+ netdb_seterr(err);
return (NULL);
}
bindaddr = getenv("FETCH_BIND_ADDRESS");
if (verbose)
- _fetch_info("connecting to %s:%d", host, port);
+ fetch_info("connecting to %s:%d", host, port);
/* try to connect */
for (sd = -1, res = res0; res; sd = -1, res = res->ai_next) {
@@ -288,8 +288,8 @@
res->ai_protocol)) == -1)
continue;
if (bindaddr != NULL && *bindaddr != '\0' &&
- _fetch_bind(sd, res->ai_family, bindaddr) != 0) {
- _fetch_info("failed to bind to '%s'", bindaddr);
+ fetch_bind(sd, res->ai_family, bindaddr) != 0) {
+ fetch_info("failed to bind to '%s'", bindaddr);
close(sd);
continue;
}
@@ -299,12 +299,12 @@
}
freeaddrinfo(res0);
if (sd == -1) {
- _fetch_syserr();
+ fetch_syserr();
return (NULL);
}
- if ((conn = _fetch_reopen(sd)) == NULL) {
- _fetch_syserr();
+ if ((conn = fetch_reopen(sd)) == NULL) {
+ fetch_syserr();
close(sd);
}
return (conn);
@@ -315,7 +315,7 @@
* Enable SSL on a connection.
*/
int
-_fetch_ssl(conn_t *conn, int verbose)
+fetch_ssl(conn_t *conn, int verbose)
{
#ifdef WITH_SSL
@@ -373,7 +373,7 @@
* Read a character from a connection w/ timeout
*/
ssize_t
-_fetch_read(conn_t *conn, char *buf, size_t len)
+fetch_read(conn_t *conn, char *buf, size_t len)
{
struct timeval now, timeout, wait;
fd_set readfds;
@@ -399,7 +399,7 @@
}
if (wait.tv_sec < 0) {
errno = ETIMEDOUT;
- _fetch_syserr();
+ fetch_syserr();
return (-1);
}
errno = 0;
@@ -407,7 +407,7 @@
if (r == -1) {
if (errno == EINTR && fetchRestartCalls)
continue;
- _fetch_syserr();
+ fetch_syserr();
return (-1);
}
}
@@ -438,7 +438,7 @@
#define MIN_BUF_SIZE 1024
int
-_fetch_getln(conn_t *conn)
+fetch_getln(conn_t *conn)
{
char *tmp;
size_t tmpsize;
@@ -457,7 +457,7 @@
conn->buflen = 0;
do {
- len = _fetch_read(conn, &c, 1);
+ len = fetch_read(conn, &c, 1);
if (len == -1)
return (-1);
if (len == 0)
@@ -485,13 +485,13 @@
* Write to a connection w/ timeout
*/
ssize_t
-_fetch_write(conn_t *conn, const char *buf, size_t len)
+fetch_write(conn_t *conn, const char *buf, size_t len)
{
struct iovec iov;
iov.iov_base = __DECONST(char *, buf);
iov.iov_len = len;
- return _fetch_writev(conn, &iov, 1);
+ return fetch_writev(conn, &iov, 1);
}
/*
@@ -499,7 +499,7 @@
* Note: can modify the iovec.
*/
ssize_t
-_fetch_writev(conn_t *conn, struct iovec *iov, int iovcnt)
+fetch_writev(conn_t *conn, struct iovec *iov, int iovcnt)
{
struct timeval now, timeout, wait;
fd_set writefds;
@@ -525,7 +525,7 @@
}
if (wait.tv_sec < 0) {
errno = ETIMEDOUT;
- _fetch_syserr();
+ fetch_syserr();
return (-1);
}
errno = 0;
@@ -547,7 +547,7 @@
if (wlen == 0) {
/* we consider a short write a failure */
errno = EPIPE;
- _fetch_syserr();
+ fetch_syserr();
return (-1);
}
if (wlen < 0) {
@@ -574,7 +574,7 @@
* Write a line of text to a connection w/ timeout
*/
int
-_fetch_putln(conn_t *conn, const char *str, size_t len)
+fetch_putln(conn_t *conn, const char *str, size_t len)
{
struct iovec iov[2];
int ret;
@@ -585,9 +585,9 @@
iov[1].iov_base = __DECONST(char *, ENDL);
iov[1].iov_len = sizeof(ENDL);
if (len == 0)
- ret = _fetch_writev(conn, &iov[1], 1);
+ ret = fetch_writev(conn, &iov[1], 1);
else
- ret = _fetch_writev(conn, iov, 2);
+ ret = fetch_writev(conn, iov, 2);
if (ret == -1)
return (-1);
return (0);
@@ -598,7 +598,7 @@
* Close connection
*/
int
-_fetch_close(conn_t *conn)
+fetch_close(conn_t *conn)
{
int ret;
@@ -614,7 +614,7 @@
/*** Directory-related utility functions *************************************/
int
-_fetch_add_entry(struct url_ent **p, int *size, int *len,
+fetch_add_entry(struct url_ent **p, int *size, int *len,
const char *name, struct url_stat *us)
{
struct url_ent *tmp;
@@ -628,7 +628,7 @@
tmp = realloc(*p, (*size * 2 + 1) * sizeof(**p));
if (tmp == NULL) {
errno = ENOMEM;
- _fetch_syserr();
+ fetch_syserr();
return (-1);
}
*size = (*size * 2 + 1);
@@ -649,7 +649,7 @@
/*** Authentication-related utility functions ********************************/
static const char *
-_fetch_read_word(FILE *f)
+fetch_read_word(FILE *f)
{
static char word[1024];
@@ -662,7 +662,7 @@
* Get authentication data for a URL from .netrc
*/
int
-_fetch_netrc_auth(struct url *url)
+fetch_netrc_auth(struct url *url)
{
char fn[PATH_MAX];
const char *word;
@@ -671,7 +671,7 @@
if ((p = getenv("NETRC")) != NULL) {
if (snprintf(fn, sizeof(fn), "%s", p) >= (int)sizeof(fn)) {
- _fetch_info("$NETRC specifies a file name "
+ fetch_info("$NETRC specifies a file name "
"longer than PATH_MAX");
return (-1);
}
@@ -689,39 +689,39 @@
if ((f = fopen(fn, "r")) == NULL)
return (-1);
- while ((word = _fetch_read_word(f)) != NULL) {
+ while ((word = fetch_read_word(f)) != NULL) {
if (strcmp(word, "default") == 0) {
- DEBUG(_fetch_info("Using default .netrc settings"));
+ DEBUG(fetch_info("Using default .netrc settings"));
break;
}
if (strcmp(word, "machine") == 0 &&
- (word = _fetch_read_word(f)) != NULL &&
+ (word = fetch_read_word(f)) != NULL &&
strcasecmp(word, url->host) == 0) {
- DEBUG(_fetch_info("Using .netrc settings for %s", word));
+ DEBUG(fetch_info("Using .netrc settings for %s", word));
break;
}
}
if (word == NULL)
goto ferr;
- while ((word = _fetch_read_word(f)) != NULL) {
+ while ((word = fetch_read_word(f)) != NULL) {
if (strcmp(word, "login") == 0) {
- if ((word = _fetch_read_word(f)) == NULL)
+ if ((word = fetch_read_word(f)) == NULL)
goto ferr;
if (snprintf(url->user, sizeof(url->user),
"%s", word) > (int)sizeof(url->user)) {
- _fetch_info("login name in .netrc is too long");
+ fetch_info("login name in .netrc is too long");
url->user[0] = '\0';
}
} else if (strcmp(word, "password") == 0) {
- if ((word = _fetch_read_word(f)) == NULL)
+ if ((word = fetch_read_word(f)) == NULL)
goto ferr;
if (snprintf(url->pwd, sizeof(url->pwd),
"%s", word) > (int)sizeof(url->pwd)) {
- _fetch_info("password in .netrc is too long");
+ fetch_info("password in .netrc is too long");
url->pwd[0] = '\0';
}
} else if (strcmp(word, "account") == 0) {
- if ((word = _fetch_read_word(f)) == NULL)
+ if ((word = fetch_read_word(f)) == NULL)
goto ferr;
/* XXX not supported! */
} else {
==== //depot/projects/e500/lib/libfetch/common.h#2 (text+ko) ====
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libfetch/common.h,v 1.28 2004/09/21 18:35:20 des Exp $
+ * $FreeBSD: src/lib/libfetch/common.h,v 1.29 2007/12/14 10:26:58 des Exp $
*/
#ifndef _COMMON_H_INCLUDED
@@ -68,33 +68,33 @@
const char *string;
};
-/* for _fetch_writev */
+/* for fetch_writev */
struct iovec;
-void _fetch_seterr(struct fetcherr *, int);
-void _fetch_syserr(void);
-void _fetch_info(const char *, ...);
-int _fetch_default_port(const char *);
-int _fetch_default_proxy_port(const char *);
-int _fetch_bind(int, int, const char *);
-conn_t *_fetch_connect(const char *, int, int, int);
-conn_t *_fetch_reopen(int);
-conn_t *_fetch_ref(conn_t *);
-int _fetch_ssl(conn_t *, int);
-ssize_t _fetch_read(conn_t *, char *, size_t);
-int _fetch_getln(conn_t *);
-ssize_t _fetch_write(conn_t *, const char *, size_t);
-ssize_t _fetch_writev(conn_t *, struct iovec *, int);
-int _fetch_putln(conn_t *, const char *, size_t);
-int _fetch_close(conn_t *);
-int _fetch_add_entry(struct url_ent **, int *, int *,
+void fetch_seterr(struct fetcherr *, int);
+void fetch_syserr(void);
+void fetch_info(const char *, ...);
+int fetch_default_port(const char *);
+int fetch_default_proxy_port(const char *);
+int fetch_bind(int, int, const char *);
+conn_t *fetch_connect(const char *, int, int, int);
+conn_t *fetch_reopen(int);
+conn_t *fetch_ref(conn_t *);
+int fetch_ssl(conn_t *, int);
+ssize_t fetch_read(conn_t *, char *, size_t);
+int fetch_getln(conn_t *);
+ssize_t fetch_write(conn_t *, const char *, size_t);
+ssize_t fetch_writev(conn_t *, struct iovec *, int);
+int fetch_putln(conn_t *, const char *, size_t);
+int fetch_close(conn_t *);
+int fetch_add_entry(struct url_ent **, int *, int *,
const char *, struct url_stat *);
-int _fetch_netrc_auth(struct url *url);
+int fetch_netrc_auth(struct url *url);
-#define _ftp_seterr(n) _fetch_seterr(_ftp_errlist, n)
-#define _http_seterr(n) _fetch_seterr(_http_errlist, n)
-#define _netdb_seterr(n) _fetch_seterr(_netdb_errlist, n)
-#define _url_seterr(n) _fetch_seterr(_url_errlist, n)
+#define ftp_seterr(n) fetch_seterr(ftp_errlist, n)
+#define http_seterr(n) fetch_seterr(http_errlist, n)
+#define netdb_seterr(n) fetch_seterr(netdb_errlist, n)
+#define url_seterr(n) fetch_seterr(url_errlist, n)
#ifndef NDEBUG
#define DEBUG(x) do { if (fetchDebug) { x; } } while (0)
@@ -103,7 +103,7 @@
#endif
/*
- * I don't really like exporting _http_request() and _ftp_request(),
+ * I don't really like exporting http_request() and ftp_request(),
* but the HTTP and FTP code occasionally needs to cross-call
* eachother, and this saves me from adding a lot of special-case code
* to handle those cases.
@@ -111,9 +111,9 @@
* Note that _*_request() free purl, which is way ugly but saves us a
* whole lot of trouble.
*/
-FILE *_http_request(struct url *, const char *,
+FILE *http_request(struct url *, const char *,
struct url_stat *, struct url *, const char *);
-FILE *_ftp_request(struct url *, const char *,
+FILE *ftp_request(struct url *, const char *,
struct url_stat *, struct url *, const char *);
/*
==== //depot/projects/e500/lib/libfetch/fetch.c#2 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libfetch/fetch.c,v 1.38 2004/09/21 18:35:20 des Exp $");
+__FBSDID("$FreeBSD: src/lib/libfetch/fetch.c,v 1.39 2007/12/14 10:26:58 des Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@@ -56,7 +56,7 @@
#define URL_MALFORMED 1
#define URL_BAD_SCHEME 2
#define URL_BAD_PORT 3
-static struct fetcherr _url_errlist[] = {
+static struct fetcherr url_errlist[] = {
{ URL_MALFORMED, FETCH_URL, "Malformed URL" },
{ URL_BAD_SCHEME, FETCH_URL, "Invalid URL scheme" },
{ URL_BAD_PORT, FETCH_URL, "Invalid server port" },
@@ -89,7 +89,7 @@
return (fetchXGetHTTP(URL, us, flags));
else if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0)
return (fetchXGetHTTP(URL, us, flags));
- _url_seterr(URL_BAD_SCHEME);
+ url_seterr(URL_BAD_SCHEME);
return (NULL);
}
@@ -121,7 +121,7 @@
return (fetchPutHTTP(URL, flags));
else if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0)
return (fetchPutHTTP(URL, flags));
- _url_seterr(URL_BAD_SCHEME);
+ url_seterr(URL_BAD_SCHEME);
return (NULL);
}
@@ -147,7 +147,7 @@
return (fetchStatHTTP(URL, us, flags));
else if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0)
return (fetchStatHTTP(URL, us, flags));
- _url_seterr(URL_BAD_SCHEME);
+ url_seterr(URL_BAD_SCHEME);
return (-1);
}
@@ -169,7 +169,7 @@
return (fetchListHTTP(URL, flags));
else if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0)
return (fetchListHTTP(URL, flags));
- _url_seterr(URL_BAD_SCHEME);
+ url_seterr(URL_BAD_SCHEME);
return (NULL);
}
@@ -264,23 +264,23 @@
struct url *u;
if (!scheme || (!host && !doc)) {
- _url_seterr(URL_MALFORMED);
+ url_seterr(URL_MALFORMED);
return (NULL);
}
if (port < 0 || port > 65535) {
- _url_seterr(URL_BAD_PORT);
+ url_seterr(URL_BAD_PORT);
return (NULL);
}
/* allocate struct url */
if ((u = calloc(1, sizeof(*u))) == NULL) {
- _fetch_syserr();
+ fetch_syserr();
return (NULL);
}
if ((u->doc = strdup(doc ? doc : "/")) == NULL) {
- _fetch_syserr();
+ fetch_syserr();
free(u);
return (NULL);
}
@@ -311,7 +311,7 @@
/* allocate struct url */
if ((u = calloc(1, sizeof(*u))) == NULL) {
- _fetch_syserr();
+ fetch_syserr();
return (NULL);
}
@@ -373,7 +373,7 @@
u->port = u->port * 10 + (*q - '0');
else {
/* invalid port */
- _url_seterr(URL_BAD_PORT);
+ url_seterr(URL_BAD_PORT);
goto ouch;
}
p = q;
@@ -390,7 +390,7 @@
/* percent-escape whitespace. */
if ((doc = malloc(strlen(p) * 3 + 1)) == NULL) {
- _fetch_syserr();
+ fetch_syserr();
goto ouch;
}
u->doc = doc;
@@ -406,7 +406,7 @@
}
*doc = '\0';
} else if ((u->doc = strdup(p)) == NULL) {
- _fetch_syserr();
+ fetch_syserr();
goto ouch;
}
==== //depot/projects/e500/lib/libfetch/file.c#2 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libfetch/file.c,v 1.17 2004/09/21 18:35:20 des Exp $");
+__FBSDID("$FreeBSD: src/lib/libfetch/file.c,v 1.18 2007/12/14 10:26:58 des Exp $");
#include <sys/param.h>
#include <sys/stat.h>
@@ -50,11 +50,11 @@
f = fopen(u->doc, "r");
if (f == NULL)
- _fetch_syserr();
+ fetch_syserr();
if (u->offset && fseeko(f, u->offset, SEEK_SET) == -1) {
fclose(f);
- _fetch_syserr();
+ fetch_syserr();
}
return (f);
@@ -77,25 +77,25 @@
f = fopen(u->doc, "w+");
if (f == NULL)
- _fetch_syserr();
+ fetch_syserr();
if (u->offset && fseeko(f, u->offset, SEEK_SET) == -1) {
fclose(f);
- _fetch_syserr();
+ fetch_syserr();
}
return (f);
}
static int
-_fetch_stat_file(const char *fn, struct url_stat *us)
+fetch_stat_file(const char *fn, struct url_stat *us)
{
struct stat sb;
us->size = -1;
us->atime = us->mtime = 0;
if (stat(fn, &sb) == -1) {
- _fetch_syserr();
+ fetch_syserr();
return (-1);
}
us->size = sb.st_size;
@@ -107,7 +107,7 @@
int
fetchStatFile(struct url *u, struct url_stat *us, const char *flags __unused)
{
- return (_fetch_stat_file(u->doc, us));
+ return (fetch_stat_file(u->doc, us));
}
struct url_ent *
@@ -122,7 +122,7 @@
int l;
if ((dir = opendir(u->doc)) == NULL) {
- _fetch_syserr();
+ fetch_syserr();
return (NULL);
}
@@ -136,10 +136,10 @@
while ((de = readdir(dir)) != NULL) {
strncpy(p, de->d_name, l - 1);
p[l - 1] = 0;
- if (_fetch_stat_file(fn, &us) == -1)
+ if (fetch_stat_file(fn, &us) == -1)
/* should I return a partial result, or abort? */
break;
- _fetch_add_entry(&ue, &size, &len, de->d_name, &us);
+ fetch_add_entry(&ue, &size, &len, de->d_name, &us);
}
return (ue);
==== //depot/projects/e500/lib/libfetch/ftp.c#2 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libfetch/ftp.c,v 1.96 2007/04/22 22:33:29 njl Exp $");
+__FBSDID("$FreeBSD: src/lib/libfetch/ftp.c,v 1.97 2007/12/14 10:26:58 des Exp $");
/*
* Portions of this code were taken from or based on ftpio.c:
@@ -135,16 +135,16 @@
* Get server response
*/
static int
-_ftp_chkerr(conn_t *conn)
+ftp_chkerr(conn_t *conn)
{
- if (_fetch_getln(conn) == -1) {
- _fetch_syserr();
+ if (fetch_getln(conn) == -1) {
+ fetch_syserr();
return (-1);
}
if (isftpinfo(conn->buf)) {
while (conn->buflen && !isftpreply(conn->buf)) {
- if (_fetch_getln(conn) == -1) {
- _fetch_syserr();
+ if (fetch_getln(conn) == -1) {
+ fetch_syserr();
return (-1);
}
}
@@ -155,7 +155,7 @@
conn->buf[conn->buflen] = '\0';
if (!isftpreply(conn->buf)) {
- _ftp_seterr(FTP_PROTOCOL_ERROR);
+ ftp_seterr(FTP_PROTOCOL_ERROR);
return (-1);
}
@@ -170,7 +170,7 @@
* Send a command and check reply
*/
static int
-_ftp_cmd(conn_t *conn, const char *fmt, ...)
+ftp_cmd(conn_t *conn, const char *fmt, ...)
{
va_list ap;
size_t len;
@@ -183,26 +183,26 @@
if (msg == NULL) {
errno = ENOMEM;
- _fetch_syserr();
+ fetch_syserr();
return (-1);
}
- r = _fetch_putln(conn, msg, len);
+ r = fetch_putln(conn, msg, len);
free(msg);
if (r == -1) {
- _fetch_syserr();
+ fetch_syserr();
return (-1);
}
- return (_ftp_chkerr(conn));
+ return (ftp_chkerr(conn));
}
/*
* Return a pointer to the filename part of a path
*/
static const char *
-_ftp_filename(const char *file, int *len, int *type)
+ftp_filename(const char *file, int *len, int *type)
{
const char *s;
@@ -225,7 +225,7 @@
* command.
*/
static int
-_ftp_pwd(conn_t *conn, char *pwd, size_t pwdlen)
+ftp_pwd(conn_t *conn, char *pwd, size_t pwdlen)
{
char *src, *dst, *end;
int q;
@@ -261,7 +261,7 @@
* file.
*/
static int
-_ftp_cwd(conn_t *conn, const char *file)
+ftp_cwd(conn_t *conn, const char *file)
{
const char *beg, *end;
char pwd[PATH_MAX];
@@ -270,9 +270,9 @@
/* If no slashes in name, no need to change dirs. */
if ((end = strrchr(file, '/')) == NULL)
return (0);
- if ((e = _ftp_cmd(conn, "PWD")) != FTP_WORKING_DIRECTORY ||
- (e = _ftp_pwd(conn, pwd, sizeof(pwd))) != FTP_OK) {
- _ftp_seterr(e);
+ if ((e = ftp_cmd(conn, "PWD")) != FTP_WORKING_DIRECTORY ||
+ (e = ftp_pwd(conn, pwd, sizeof(pwd))) != FTP_OK) {
+ ftp_seterr(e);
return (-1);
}
for (;;) {
@@ -289,10 +289,10 @@
/* Keep going up a dir until we have a matching prefix. */
if (pwd[i] == '\0' && (file[i - 1] == '/' || file[i] == '/'))
break;
- if ((e = _ftp_cmd(conn, "CDUP")) != FTP_FILE_ACTION_OK ||
- (e = _ftp_cmd(conn, "PWD")) != FTP_WORKING_DIRECTORY ||
- (e = _ftp_pwd(conn, pwd, sizeof(pwd))) != FTP_OK) {
- _ftp_seterr(e);
+ if ((e = ftp_cmd(conn, "CDUP")) != FTP_FILE_ACTION_OK ||
+ (e = ftp_cmd(conn, "PWD")) != FTP_WORKING_DIRECTORY ||
+ (e = ftp_pwd(conn, pwd, sizeof(pwd))) != FTP_OK) {
+ ftp_seterr(e);
return (-1);
}
}
@@ -307,7 +307,7 @@
return (0);
/* Change to the directory all in one chunk (e.g., foo/bar/baz). */
- e = _ftp_cmd(conn, "CWD %.*s", (int)(end - beg), beg);
+ e = ftp_cmd(conn, "CWD %.*s", (int)(end - beg), beg);
if (e == FTP_FILE_ACTION_OK)
return (0);
#endif /* FTP_COMBINE_CWDS */
@@ -318,9 +318,9 @@
++beg, ++i;
for (++i; file + i < end && file[i] != '/'; ++i)
/* nothing */ ;
- e = _ftp_cmd(conn, "CWD %.*s", file + i - beg, beg);
+ e = ftp_cmd(conn, "CWD %.*s", file + i - beg, beg);
if (e != FTP_FILE_ACTION_OK) {
- _ftp_seterr(e);
+ ftp_seterr(e);
return (-1);
}
}
@@ -331,7 +331,7 @@
* Set transfer mode and data type
*/
static int
-_ftp_mode_type(conn_t *conn, int mode, int type)
+ftp_mode_type(conn_t *conn, int mode, int type)
{
int e;
@@ -344,7 +344,7 @@
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list