Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Turn into static functions, the one who are never directly called for ssh
Baptiste Daroussin committed 5 years ago
commit a9a594493b06319b22297ac3ca0520de75ca850c
parent c46eba5
3 files changed +8 -39
modified libpkg/fetch.c
@@ -47,7 +47,6 @@
#include "private/pkg.h"
#include "private/utils.h"
#include "private/fetch.h"
-
#include "private/fetch_ssh.h"

static struct fetcher {
	const char *scheme;
modified libpkg/fetch_ssh.c
@@ -42,9 +42,13 @@
#include "pkg.h"
#include "private/event.h"
#include "private/pkg.h"
-
#include "private/fetch_ssh.h"
+
#include "private/fetch.h"
#include "private/utils.h"

+
static int ssh_read(void *data, char *buf, int len);
+
static int ssh_write(void *data, const char *buf, int l);
+
static int ssh_close(void *data);
+

int
ssh_open(struct pkg_repo *repo, struct url *u, off_t *sz)
{
@@ -172,7 +176,7 @@ ssh_cleanup:
	return (retcode);
}

-
int
+
static int
ssh_close(void *data)
{
	struct pkg_repo *repo = (struct pkg_repo *)data;
@@ -257,7 +261,7 @@ ssh_writev(int fd, struct iovec *iov, int iovcnt)
	return (total);
}

-
int
+
static int
ssh_write(void *data, const char *buf, int l)
{
	struct pkg_repo *repo = (struct pkg_repo *)data;
@@ -271,7 +275,7 @@ ssh_write(void *data, const char *buf, int l)
	return (ssh_writev(repo->sshio.out, &iov, 1));
}

-
int
+
static int
ssh_read(void *data, char *buf, int len)
{
	struct pkg_repo *repo = (struct pkg_repo *) data;
deleted libpkg/private/fetch_ssh.h
@@ -1,34 +0,0 @@
-
/*-
-
 * Copyright (c) 2020 Baptiste Daroussin <bapt@FreeBSD.org>
-
 *
-
 * Redistribution and use in source and binary forms, with or without
-
 * modification, are permitted provided that the following conditions
-
 * are met:
-
 * 1. Redistributions of source code must retain the above copyright
-
 *    notice, this list of conditions and the following disclaimer
-
 *    in this position and unchanged.
-
 * 2. Redistributions in binary form must reproduce the above copyright
-
 *    notice, this list of conditions and the following disclaimer in the
-
 *    documentation and/or other materials provided with the distribution.
-
 *
-
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
-
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-
 * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
-
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 */
-

-
#ifndef _FETCH_SSH_H
-
#define _FETCH_SSH_H
-

-
int ssh_open(struct pkg_repo *, struct url *, off_t *);
-
int ssh_close(void *);
-
int ssh_write(void *, const char *, int);
-
int ssh_read(void *, char *, int);
-

-
#endif