summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/common.c
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>2001-04-24 00:06:21 +0000
committerarchie <archie@FreeBSD.org>2001-04-24 00:06:21 +0000
commit21cf7b313e0bc24fdfba9db608502a795edc2f64 (patch)
tree05583e8bec8550e39a977336f8b644648077d02e /lib/libfetch/common.c
parent6f92ffe2eb286bd4cfe49b9ef57447223e5a5858 (diff)
downloadFreeBSD-src-21cf7b313e0bc24fdfba9db608502a795edc2f64.zip
FreeBSD-src-21cf7b313e0bc24fdfba9db608502a795edc2f64.tar.gz
Apply 'const' liberally.
Fix some other minor glitches.
Diffstat (limited to 'lib/libfetch/common.c')
-rw-r--r--lib/libfetch/common.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
index 459154f..34981e9 100644
--- a/lib/libfetch/common.c
+++ b/lib/libfetch/common.c
@@ -60,7 +60,7 @@ static struct fetcherr _netdb_errlist[] = {
};
/* End-of-Line */
-static char ENDL[2] = "\r\n";
+static const char ENDL[2] = "\r\n";
/*** Error-reporting functions ***********************************************/
@@ -154,7 +154,7 @@ _fetch_syserr(void)
* Emit status message
*/
void
-_fetch_info(char *fmt, ...)
+_fetch_info(const char *fmt, ...)
{
va_list ap;
@@ -171,7 +171,7 @@ _fetch_info(char *fmt, ...)
* Return the default port for a scheme
*/
int
-_fetch_default_port(char *scheme)
+_fetch_default_port(const char *scheme)
{
struct servent *se;
@@ -188,7 +188,7 @@ _fetch_default_port(char *scheme)
* Return the default proxy port for a scheme
*/
int
-_fetch_default_proxy_port(char *scheme)
+_fetch_default_proxy_port(const char *scheme)
{
if (strcasecmp(scheme, SCHEME_FTP) == 0)
return FTP_DEFAULT_PROXY_PORT;
@@ -201,7 +201,7 @@ _fetch_default_proxy_port(char *scheme)
* Establish a TCP connection to the specified port on the specified host.
*/
int
-_fetch_connect(char *host, int port, int af, int verbose)
+_fetch_connect(const char *host, int port, int af, int verbose)
{
char pbuf[10];
struct addrinfo hints, *res, *res0;
@@ -333,15 +333,15 @@ _fetch_getln(int fd, char **buf, size_t *size, size_t *len)
* XXX currently does not enforce timeout
*/
int
-_fetch_putln(int fd, char *str, size_t len)
+_fetch_putln(int fd, const char *str, size_t len)
{
struct iovec iov[2];
ssize_t wlen;
/* XXX should enforce timeout */
- iov[0].iov_base = str;
+ iov[0].iov_base = (char *)str;
iov[0].iov_len = len;
- iov[1].iov_base = ENDL;
+ iov[1].iov_base = (char *)ENDL;
iov[1].iov_len = sizeof ENDL;
wlen = writev(fd, iov, 2);
DEBUG(fprintf(stderr, "\033[1m>>> %s\n\033[m", str));
@@ -353,7 +353,7 @@ _fetch_putln(int fd, char *str, size_t len)
int
_fetch_add_entry(struct url_ent **p, int *size, int *len,
- char *name, struct url_stat *stat)
+ const char *name, struct url_stat *stat)
{
struct url_ent *tmp;
OpenPOWER on IntegriCloud