vfs: cleaned up tcp_init()
tcp_init() is now called by every vfs which needs it and prevents itself from duplicate initialization. this is the first step to get rid of --enable-netcode and so clean up things a bit.
Этот коммит содержится в:
родитель
57c438b486
Коммит
d422e9783d
@ -1233,6 +1233,8 @@ init_fish (void)
|
||||
{
|
||||
static struct vfs_s_subclass fish_subclass;
|
||||
|
||||
tcp_init();
|
||||
|
||||
fish_subclass.flags = VFS_S_REMOTE;
|
||||
fish_subclass.archive_same = fish_archive_same;
|
||||
fish_subclass.open_archive = fish_open_archive;
|
||||
|
@ -2141,6 +2141,8 @@ init_ftpfs (void)
|
||||
{
|
||||
static struct vfs_s_subclass ftpfs_subclass;
|
||||
|
||||
tcp_init();
|
||||
|
||||
ftpfs_subclass.flags = VFS_S_REMOTE;
|
||||
ftpfs_subclass.archive_same = ftpfs_archive_same;
|
||||
ftpfs_subclass.open_archive = ftpfs_open_archive;
|
||||
|
@ -1186,6 +1186,8 @@ mcfs_setctl (struct vfs_class *me, const char *path, int ctlop, void *arg)
|
||||
void
|
||||
init_mcfs (void)
|
||||
{
|
||||
tcp_init();
|
||||
|
||||
vfs_mcfs_ops.name = "mcfs";
|
||||
vfs_mcfs_ops.prefix = "mc:";
|
||||
vfs_mcfs_ops.fill_names = mcfs_fill_names;
|
||||
|
@ -43,10 +43,16 @@ void
|
||||
tcp_init (void)
|
||||
{
|
||||
struct sigaction sa;
|
||||
static char _initialized = 0;
|
||||
|
||||
if (_initialized)
|
||||
return;
|
||||
|
||||
got_sigpipe = 0;
|
||||
sa.sa_handler = sig_pipe;
|
||||
sa.sa_flags = 0;
|
||||
sigemptyset (&sa.sa_mask);
|
||||
sigaction (SIGPIPE, &sa, NULL);
|
||||
|
||||
_initialized = 1;
|
||||
}
|
||||
|
@ -65,6 +65,7 @@
|
||||
#include "vfs.h"
|
||||
#include "vfs-impl.h"
|
||||
#include "smbfs.h"
|
||||
#include "vfs/netutil.h"
|
||||
|
||||
#define SMBFS_MAX_CONNECTIONS 16
|
||||
static const char * const IPC = "IPC$";
|
||||
@ -1967,6 +1968,8 @@ smbfs_fstat (void *data, struct stat *buf)
|
||||
void
|
||||
init_smbfs (void)
|
||||
{
|
||||
tcp_init();
|
||||
|
||||
vfs_smbfs_ops.name = "smbfs";
|
||||
vfs_smbfs_ops.prefix = "smb:";
|
||||
vfs_smbfs_ops.flags = VFSF_NOLINKS;
|
||||
|
@ -1279,7 +1279,6 @@ vfs_init (void)
|
||||
#endif /* USE_EXT2FSLIB */
|
||||
|
||||
#ifdef USE_NETCODE
|
||||
tcp_init();
|
||||
init_ftpfs ();
|
||||
init_fish ();
|
||||
#ifdef ENABLE_VFS_SMB
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user