Toggle navigation
Toggle navigation
This project
Loading...
Sign in
UT
/
clsync
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
redmine
2014-04-30 12:28:42 +0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1c3ce8c84ab679169a0ce40d07dd2b31b3f42a3d
1c3ce8c8
1 parent
71ec6d4d
glob -> ctx
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
82 additions
and
81 deletions
Makefile.am
SHORTHANDS
clsync.h
cluster.c
cluster.h
common.h
control.c
control.h
glob.h → ctx.h
main.c
main.h
socket.h
sync.c
sync.h
Makefile.am
View file @
1c3ce8c
...
...
@@ -39,7 +39,7 @@ clsync_include_HEADERS = \
clsync.h
\
malloc.h
\
indexes.h
\
glob
.h
\
ctx
.h
\
error.h
\
socket.h
\
libclsync.h
...
...
SHORTHANDS
0 → 100644
View file @
1c3ce8c
ctx - context
...
...
clsync.h
View file @
1c3ce8c
...
...
@@ -41,9 +41,9 @@ struct api_eventinfo {
};
typedef
struct
api_eventinfo
api_eventinfo_t
;
struct
glob
;
struct
ctx
;
struct
indexes
;
typedef
int
(
*
api_funct_init
)
(
struct
glob
*
,
struct
indexes
*
);
typedef
int
(
*
api_funct_init
)
(
struct
ctx
*
,
struct
indexes
*
);
typedef
int
(
*
api_funct_sync
)
(
int
n
,
api_eventinfo_t
*
);
typedef
int
(
*
api_funct_rsync
)
(
const
char
*
inclist
,
const
char
*
exclist
);
typedef
int
(
*
api_funct_deinit
)();
...
...
@@ -80,12 +80,12 @@ extern int clsyncapi_getapiversion();
/**
* @brief clsync's wrapper for function "fork()". Should be used instead of "fork()" directly, to notify clsync about child's pid.
*
* @param[in]
glob_p Pointer to "glob
"
* @param[in]
ctx_p Pointer to "ctx
"
*
* @retval -1 If error (see "man 2 fork", added error code "ECANCELED" if too many children)
* @retval 0 If child
* @retval pid Pid of child of parent. (see "man 2 fork")
*
*/
extern
pid_t
clsyncapi_fork
(
struct
glob
*
glob
_p
);
extern
pid_t
clsyncapi_fork
(
struct
ctx
*
ctx
_p
);
...
...
cluster.c
View file @
1c3ce8c
...
...
@@ -53,7 +53,7 @@ struct sockaddr_in sa_i = {0};
int
sock_o
=
-
1
;
struct
sockaddr_in
sa_o
=
{
0
};
glob_t
*
glob
_p
=
NULL
;
ctx_t
*
ctx
_p
=
NULL
;
indexes_t
*
indexes_p
=
NULL
;
pthread_t
pthread_cluster
=
0
;
...
...
@@ -875,11 +875,11 @@ static int cluster_recvproc_setid(clustercmd_t *clustercmd_p) {
// Is the node name length in message equals to our node name length? Skipping if not.
uint32_t
recv_nodename_len
;
recv_nodename_len
=
CLUSTER_RESTDATALEN
(
clustercmd_p
,
clustercmd_setiddata_t
);
if
(
recv_nodename_len
!=
glob
_p
->
cluster_nodename_len
)
if
(
recv_nodename_len
!=
ctx
_p
->
cluster_nodename_len
)
return
0
;
// Is the node name equals to ours? Skipping if not.
if
(
memcmp
(
data_setid_p
->
node_name
,
glob
_p
->
cluster_nodename
,
recv_nodename_len
))
if
(
memcmp
(
data_setid_p
->
node_name
,
ctx
_p
->
cluster_nodename
,
recv_nodename_len
))
return
0
;
// Remembering the node that answered us
...
...
@@ -897,7 +897,7 @@ extern int cluster_loop();
/**
* @brief Initializes cluster subsystem.
*
* @param[in] _
glob
_p Pointer to "glob" variable, defined in main().
* @param[in] _
ctx
_p Pointer to "glob" variable, defined in main().
* @param[in] _indexes_p Pointer to "indexes" variable, defined in sync_run().
*
* @retval zero Successfully initialized.
...
...
@@ -905,19 +905,19 @@ extern int cluster_loop();
*
*/
int
cluster_init
(
glob_t
*
_glob
_p
,
indexes_t
*
_indexes_p
)
{
int
cluster_init
(
ctx_t
*
_ctx
_p
,
indexes_t
*
_indexes_p
)
{
int
ret
;
// Preventing double initializing
if
(
glob
_p
!=
NULL
)
{
if
(
ctx
_p
!=
NULL
)
{
error
(
"cluster subsystem is already initialized."
);
return
EALREADY
;
}
// Initializing global variables, pt. 1
glob_p
=
_glob
_p
;
ctx_p
=
_ctx
_p
;
indexes_p
=
_indexes_p
;
cluster_timeout
=
glob
_p
->
cluster_timeout
;
cluster_timeout
=
ctx
_p
->
cluster_timeout
;
node_status_change
(
NODEID_NOID
,
NODESTATUS_ONLINE
);
// Initializing network routines
...
...
@@ -944,7 +944,7 @@ int cluster_init(glob_t *_glob_p, indexes_t *_indexes_p) {
// Binding
sa_i
.
sin_family
=
AF_INET
;
sa_i
.
sin_port
=
htons
(
glob
_p
->
cluster_mcastipport
);
sa_i
.
sin_port
=
htons
(
ctx
_p
->
cluster_mcastipport
);
sa_i
.
sin_addr
.
s_addr
=
INADDR_ANY
;
if
(
bind
(
sock_i
,
(
struct
sockaddr
*
)
&
sa_i
,
sizeof
(
sa_i
)))
{
...
...
@@ -955,13 +955,13 @@ int cluster_init(glob_t *_glob_p, indexes_t *_indexes_p) {
// Joining to multicast group
struct
ip_mreq
group
;
group
.
imr_interface
.
s_addr
=
inet_addr
(
glob
_p
->
cluster_iface
);
group
.
imr_multiaddr
.
s_addr
=
inet_addr
(
glob
_p
->
cluster_mcastipaddr
);
group
.
imr_interface
.
s_addr
=
inet_addr
(
ctx
_p
->
cluster_iface
);
group
.
imr_multiaddr
.
s_addr
=
inet_addr
(
ctx
_p
->
cluster_mcastipaddr
);
if
(
setsockopt
(
sock_i
,
IPPROTO_IP
,
IP_ADD_MEMBERSHIP
,
(
char
*
)
&
group
,
sizeof
(
group
))
<
0
)
{
error
(
"Cannot setsockopt() to enter to membership %s -> %s"
,
glob_p
->
cluster_iface
,
glob
_p
->
cluster_mcastipaddr
);
ctx_p
->
cluster_iface
,
ctx
_p
->
cluster_mcastipaddr
);
return
errno
;
}
...
...
@@ -978,8 +978,8 @@ int cluster_init(glob_t *_glob_p, indexes_t *_indexes_p) {
// Initializing the group sockaddr structure
sa_o
.
sin_family
=
AF_INET
;
sa_o
.
sin_port
=
htons
(
glob
_p
->
cluster_mcastipport
);
sa_o
.
sin_addr
.
s_addr
=
inet_addr
(
glob
_p
->
cluster_mcastipaddr
);
sa_o
.
sin_port
=
htons
(
ctx
_p
->
cluster_mcastipport
);
sa_o
.
sin_addr
.
s_addr
=
inet_addr
(
ctx
_p
->
cluster_mcastipaddr
);
// Disable looping back output datagrams
...
...
@@ -995,7 +995,7 @@ int cluster_init(glob_t *_glob_p, indexes_t *_indexes_p) {
{
struct
in_addr
addr_o
;
addr_o
.
s_addr
=
inet_addr
(
glob
_p
->
cluster_iface
);
addr_o
.
s_addr
=
inet_addr
(
ctx
_p
->
cluster_iface
);
if
(
setsockopt
(
sock_o
,
IPPROTO_IP
,
IP_MULTICAST_IF
,
&
addr_o
,
sizeof
(
addr_o
))
<
0
)
{
error
(
"Cannot set local interface for outbound traffic"
);
return
errno
;
...
...
@@ -1011,10 +1011,10 @@ int cluster_init(glob_t *_glob_p, indexes_t *_indexes_p) {
// Trying to preserve my node_id after restart. :)
// Asking another nodes about my previous node_id
{
clustercmd_t
*
clustercmd_p
=
CLUSTER_ALLOCA
(
clustercmd_getmyid_t
,
glob
_p
->
cluster_nodename_len
);
clustercmd_t
*
clustercmd_p
=
CLUSTER_ALLOCA
(
clustercmd_getmyid_t
,
ctx
_p
->
cluster_nodename_len
);
clustercmd_p
->
h
.
data_len
=
glob
_p
->
cluster_nodename_len
;
memcpy
(
clustercmd_p
->
data
.
getmyid
.
node_name
,
glob
_p
->
cluster_nodename
,
clustercmd_p
->
h
.
data_len
+
1
);
clustercmd_p
->
h
.
data_len
=
ctx
_p
->
cluster_nodename_len
;
memcpy
(
clustercmd_p
->
data
.
getmyid
.
node_name
,
ctx
_p
->
cluster_nodename
,
clustercmd_p
->
h
.
data_len
+
1
);
clustercmd_p
->
h
.
cmd_id
=
CLUSTERCMDID_GETMYID
;
clustercmd_p
->
h
.
dst_node_id
=
NODEID_NOID
;
// broadcast
...
...
@@ -1054,12 +1054,12 @@ int cluster_init(glob_t *_glob_p, indexes_t *_indexes_p) {
// Sending registration information
node_status_change
(
node_id_my
,
NODESTATUS_SEEMSONLINE
);
{
clustercmd_t
*
clustercmd_p
=
CLUSTER_ALLOCA
(
clustercmd_reg_t
,
glob
_p
->
cluster_nodename_len
);
clustercmd_t
*
clustercmd_p
=
CLUSTER_ALLOCA
(
clustercmd_reg_t
,
ctx
_p
->
cluster_nodename_len
);
clustercmd_reg_t
*
data_reg_p
=
&
clustercmd_p
->
data
.
reg
;
memcpy
(
data_reg_p
->
node_name
,
glob_p
->
cluster_nodename
,
glob
_p
->
cluster_nodename_len
+
1
);
memcpy
(
data_reg_p
->
node_name
,
ctx_p
->
cluster_nodename
,
ctx
_p
->
cluster_nodename_len
+
1
);
clustercmd_p
->
h
.
data_len
=
glob
_p
->
cluster_nodename_len
+
1
;
clustercmd_p
->
h
.
data_len
=
ctx
_p
->
cluster_nodename_len
+
1
;
clustercmd_p
->
h
.
cmd_id
=
CLUSTERCMDID_REG
;
clustercmd_p
->
h
.
dst_node_id
=
NODEID_NOID
;
// broadcast
if
((
ret
=
cluster_send
(
clustercmd_p
)))
...
...
@@ -1284,13 +1284,13 @@ int cluster_modtime_update(const char *path, short int dirlevel, mode_t st_mode)
int
ret
;
// Getting relative directory level (depth)
short
int
dirlevel_rel
=
dirlevel
-
glob
_p
->
watchdir_dirlevel
;
short
int
dirlevel_rel
=
dirlevel
-
ctx
_p
->
watchdir_dirlevel
;
if
((
st_mode
&
S_IFMT
)
==
S_IFDIR
)
dirlevel_rel
++
;
// Don't remembering information about directories with level beyond the limits
if
((
dirlevel_rel
>
glob_p
->
cluster_scan_dl_max
)
||
(
dirlevel_rel
<
glob
_p
->
cluster_hash_dl_min
))
if
((
dirlevel_rel
>
ctx_p
->
cluster_scan_dl_max
)
||
(
dirlevel_rel
<
ctx
_p
->
cluster_hash_dl_min
))
return
0
;
...
...
@@ -1318,8 +1318,8 @@ int cluster_modtime_update(const char *path, short int dirlevel, mode_t st_mode)
char
*
dirpath_rel_p
=
xmalloc
(
dirpath_len
+
1
);
char
*
dirpath_rel
=
dirpath_rel_p
;
const
char
*
dirpath_rel_full
=
&
dirpath
[
glob
_p
->
watchdirlen
];
size_t
dirpath_rel_full_len
=
dirpath_len
-
glob
_p
->
watchdirlen
;
const
char
*
dirpath_rel_full
=
&
dirpath
[
ctx
_p
->
watchdirlen
];
size_t
dirpath_rel_full_len
=
dirpath_len
-
ctx
_p
->
watchdirlen
;
// Getting coodinate of the end (directory path is already canonized, so we can simply count number of slashes to get directory level)
int
slashcount
=
0
;
...
...
@@ -1327,7 +1327,7 @@ int cluster_modtime_update(const char *path, short int dirlevel, mode_t st_mode)
while
(
dirpath_rel_full
[
dirpath_rel_end
]
&&
(
dirpath_rel_end
<
dirpath_rel_full_len
))
{
if
(
dirpath_rel_full
[
dirpath_rel_end
]
==
'/'
)
{
slashcount
++
;
if
(
slashcount
>=
glob
_p
->
cluster_hash_dl_max
)
if
(
slashcount
>=
ctx
_p
->
cluster_hash_dl_max
)
break
;
}
dirpath_rel_end
++
;
...
...
cluster.h
View file @
1c3ce8c
...
...
@@ -244,7 +244,7 @@ typedef int (*cluster_recvproc_funct_t)(clustercmd_t *clustercmd_p);
// Externs
extern
int
cluster_init
(
glob_t
*
glob
_p
,
indexes_t
*
indexes_p
);
extern
int
cluster_init
(
ctx_t
*
ctx
_p
,
indexes_t
*
indexes_p
);
extern
int
cluster_deinit
();
extern
int
cluster_lock
(
const
char
*
fpath
);
...
...
common.h
View file @
1c3ce8c
...
...
@@ -69,7 +69,7 @@
#endif
#include "clsync.h"
#include "
glob
.h"
#include "
ctx
.h"
#include "indexes.h"
#ifndef MIN
...
...
@@ -172,7 +172,7 @@ struct eventinfo {
typedef
struct
eventinfo
eventinfo_t
;
typedef
int
(
*
thread_callbackfunct_t
)(
glob_t
*
glob
_p
,
char
**
argv
);
typedef
int
(
*
thread_callbackfunct_t
)(
ctx_t
*
ctx
_p
,
char
**
argv
);
struct
threadinfo
{
int
thread_num
;
thread_callbackfunct_t
callback
;
...
...
@@ -181,7 +181,7 @@ struct threadinfo {
int
exitcode
;
int
errcode
;
state_t
state
;
glob_t
*
glob
_p
;
ctx_t
*
ctx
_p
;
time_t
starttime
;
time_t
expiretime
;
int
child_pid
;
...
...
@@ -219,7 +219,7 @@ struct dosync_arg {
char
excf_path
[
PATH_MAX
+
1
];
char
outf_path
[
PATH_MAX
+
1
];
FILE
*
outf
;
glob_t
*
glob
_p
;
ctx_t
*
ctx
_p
;
indexes_t
*
indexes_p
;
void
*
data
;
int
linescount
;
...
...
@@ -265,7 +265,7 @@ enum initsync {
typedef
enum
initsync
initsync_t
;
struct
sighandler_arg
{
glob_t
*
glob
_p
;
ctx_t
*
ctx
_p
;
// indexes_t *indexes_p;
pthread_t
pthread_parent
;
int
*
exitcode_p
;
...
...
control.c
View file @
1c3ce8c
...
...
@@ -30,11 +30,11 @@ static pthread_t pthread_control;
int
control_procclsyncsock
(
socket_sockthreaddata_t
*
arg
,
sockcmd_t
*
sockcmd_p
)
{
clsyncsock_t
*
clsyncsock_p
=
arg
->
clsyncsock_p
;
glob_t
*
glob_p
=
(
glob
_t
*
)
arg
->
arg
;
ctx_t
*
ctx_p
=
(
ctx
_t
*
)
arg
->
arg
;
switch
(
sockcmd_p
->
cmd_id
)
{
case
SOCKCMD_REQUEST_INFO
:
{
socket_send
(
clsyncsock_p
,
SOCKCMD_REPLY_INFO
,
glob_p
->
config_block
,
glob_p
->
label
,
glob_p
->
flags
,
glob
_p
->
flags_set
);
socket_send
(
clsyncsock_p
,
SOCKCMD_REPLY_INFO
,
ctx_p
->
config_block
,
ctx_p
->
label
,
ctx_p
->
flags
,
ctx
_p
->
flags_set
);
break
;
}
case
SOCKCMD_REQUEST_DIE
:
{
...
...
@@ -48,26 +48,26 @@ int control_procclsyncsock(socket_sockthreaddata_t *arg, sockcmd_t *sockcmd_p) {
return
0
;
}
static
inline
void
closecontrol
(
glob_t
*
glob
_p
)
{
if
(
glob
_p
->
socket
)
{
close
(
glob
_p
->
socket
);
glob
_p
->
socket
=
0
;
static
inline
void
closecontrol
(
ctx_t
*
ctx
_p
)
{
if
(
ctx
_p
->
socket
)
{
close
(
ctx
_p
->
socket
);
ctx
_p
->
socket
=
0
;
}
}
int
control_loop
(
glob_t
*
glob
_p
)
{
int
control_loop
(
ctx_t
*
ctx
_p
)
{
// Starting
debug
(
1
,
"started (
glob_p->socket == %u)"
,
glob
_p
->
socket
);
debug
(
1
,
"started (
ctx_p->socket == %u)"
,
ctx
_p
->
socket
);
int
s
;
while
((
s
=
glob
_p
->
socket
))
{
while
((
s
=
ctx
_p
->
socket
))
{
// Check if the socket is still alive
if
(
socket_check_bysock
(
s
))
{
debug
(
1
,
"Control socket closed [case 0]: %s"
,
strerror
(
errno
));
closecontrol
(
glob
_p
);
closecontrol
(
ctx
_p
);
continue
;
}
...
...
@@ -91,13 +91,13 @@ int control_loop(glob_t *glob_p) {
if
(
count
<
0
)
{
debug
(
1
,
"Got negative events count. Closing the socket."
);
closecontrol
(
glob
_p
);
closecontrol
(
ctx
_p
);
continue
;
}
if
(
!
FD_ISSET
(
s
,
&
rfds
))
{
error
(
"Got event, but not on the control socket. Closing the socket (cannot use
\"
select()
\"
)."
);
closecontrol
(
glob
_p
);
closecontrol
(
ctx
_p
);
continue
;
}
...
...
@@ -111,7 +111,7 @@ int control_loop(glob_t *glob_p) {
// Got unknown error. Closing control socket just in case.
error
(
"Cannot socket_accept()"
);
closecontrol
(
glob
_p
);
closecontrol
(
ctx
_p
);
continue
;
}
...
...
@@ -120,20 +120,20 @@ int control_loop(glob_t *glob_p) {
if
(
threaddata_p
==
NULL
)
{
error
(
"Cannot create a thread for connection"
);
closecontrol
(
glob
_p
);
closecontrol
(
ctx
_p
);
continue
;
}
threaddata_p
->
procfunct
=
control_procclsyncsock
;
threaddata_p
->
clsyncsock_p
=
clsyncsock_p
;
threaddata_p
->
arg
=
glob
_p
;
threaddata_p
->
running
=
&
glob
_p
->
socket
;
threaddata_p
->
authtype
=
glob
_p
->
flags
[
SOCKETAUTH
];
threaddata_p
->
arg
=
ctx
_p
;
threaddata_p
->
running
=
&
ctx
_p
->
socket
;
threaddata_p
->
authtype
=
ctx
_p
->
flags
[
SOCKETAUTH
];
threaddata_p
->
flags
=
0
;
if
(
socket_thread_start
(
threaddata_p
))
{
error
(
"Cannot start a thread for connection"
);
closecontrol
(
glob
_p
);
closecontrol
(
ctx
_p
);
continue
;
}
#ifdef DEBUG
...
...
@@ -148,8 +148,8 @@ int control_loop(glob_t *glob_p) {
return
0
;
}
int
control_run
(
glob_t
*
glob
_p
)
{
if
(
glob
_p
->
socketpath
!=
NULL
)
{
int
control_run
(
ctx_t
*
ctx
_p
)
{
if
(
ctx
_p
->
socketpath
!=
NULL
)
{
int
ret
=
0
;
int
s
=
-
1
;
...
...
@@ -159,7 +159,7 @@ int control_run(glob_t *glob_p) {
if
(
!
ret
)
{
clsyncsock_t
*
clsyncsock
=
socket_listen_unix
(
glob
_p
->
socketpath
);
clsyncsock_t
*
clsyncsock
=
socket_listen_unix
(
ctx
_p
->
socketpath
);
if
(
clsyncsock
==
NULL
)
{
ret
=
errno
;
}
else
{
...
...
@@ -170,16 +170,16 @@ int control_run(glob_t *glob_p) {
// fixing privileges
if
(
!
ret
)
{
if
(
glob
_p
->
flags
[
SOCKETMOD
])
if
(
chmod
(
glob_p
->
socketpath
,
glob
_p
->
socketmod
))
{
if
(
ctx
_p
->
flags
[
SOCKETMOD
])
if
(
chmod
(
ctx_p
->
socketpath
,
ctx
_p
->
socketmod
))
{
error
(
"Error, Cannot chmod(
\"
%s
\"
, %o)"
,
glob_p
->
socketpath
,
glob
_p
->
socketmod
);
ctx_p
->
socketpath
,
ctx
_p
->
socketmod
);
ret
=
errno
;
}
if
(
glob
_p
->
flags
[
SOCKETOWN
])
if
(
chown
(
glob_p
->
socketpath
,
glob_p
->
socketuid
,
glob
_p
->
socketgid
))
{
if
(
ctx
_p
->
flags
[
SOCKETOWN
])
if
(
chown
(
ctx_p
->
socketpath
,
ctx_p
->
socketuid
,
ctx
_p
->
socketgid
))
{
error
(
"Error, Cannot chown(
\"
%s
\"
, %u, %u)"
,
glob_p
->
socketpath
,
glob_p
->
socketuid
,
glob
_p
->
socketgid
);
ctx_p
->
socketpath
,
ctx_p
->
socketuid
,
ctx
_p
->
socketgid
);
ret
=
errno
;
}
}
...
...
@@ -190,20 +190,20 @@ int control_run(glob_t *glob_p) {
return
ret
;
}
glob
_p
->
socket
=
s
;
ctx
_p
->
socket
=
s
;
debug
(
2
,
"
glob_p->socket = %u"
,
glob
_p
->
socket
);
debug
(
2
,
"
ctx_p->socket = %u"
,
ctx
_p
->
socket
);
ret
=
pthread_create
(
&
pthread_control
,
NULL
,
(
void
*
(
*
)(
void
*
))
control_loop
,
glob
_p
);
ret
=
pthread_create
(
&
pthread_control
,
NULL
,
(
void
*
(
*
)(
void
*
))
control_loop
,
ctx
_p
);
}
return
0
;
}
int
control_cleanup
(
glob_t
*
glob
_p
)
{
if
(
glob
_p
->
socketpath
!=
NULL
)
{
unlink
(
glob
_p
->
socketpath
);
closecontrol
(
glob
_p
);
int
control_cleanup
(
ctx_t
*
ctx
_p
)
{
if
(
ctx
_p
->
socketpath
!=
NULL
)
{
unlink
(
ctx
_p
->
socketpath
);
closecontrol
(
ctx
_p
);
// TODO: kill pthread_control and join
// pthread_join(pthread_control, NULL);
socket_deinit
();
...
...
control.h
View file @
1c3ce8c
...
...
@@ -20,8 +20,8 @@
#ifndef __CLSYNC_CONTROL_H
#define __CLSYNC_CONTROL_H
extern
int
control_run
(
glob_t
*
glob
_p
);
extern
int
control_cleanup
(
glob_t
*
glob
_p
);
extern
int
control_run
(
ctx_t
*
ctx
_p
);
extern
int
control_cleanup
(
ctx_t
*
ctx
_p
);
#endif
...
...
glob
.h
→
ctx
.h
View file @
1c3ce8c
...
...
@@ -18,8 +18,8 @@
*/
#ifndef __CLSYNC_
GLOB
_H
#define __CLSYNC_
GLOB
_H
#ifndef __CLSYNC_
CTX
_H
#define __CLSYNC_
CTX
_H
#include <regex.h>
...
...
@@ -160,7 +160,7 @@ struct api_functs {
};
typedef
struct
api_functs
api_functs_t
;
struct
glob
{
struct
ctx
{
#ifndef LIBCLSYNC
uid_t
uid
;
gid_t
gid
;
...
...
@@ -224,7 +224,7 @@ struct glob {
char
isignoredexitcode
[(
1
<<
8
)];
#endif
};
typedef
struct
glob
glob
_t
;
typedef
struct
ctx
ctx
_t
;
#endif
...
...
main.c
View file @
1c3ce8c
This diff is collapsed. Click to expand it.
main.h
View file @
1c3ce8c
...
...
@@ -17,6 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
extern
int
main_rehash
(
glob_t
*
glob
_p
);
extern
int
main_status_update
(
glob_t
*
glob
_p
,
state_t
state
);
extern
int
main_rehash
(
ctx_t
*
ctx
_p
);
extern
int
main_status_update
(
ctx_t
*
ctx
_p
,
state_t
state
);
...
...
socket.h
View file @
1c3ce8c
...
...
@@ -122,7 +122,7 @@ struct sockcmd_dat_version {
};
typedef
struct
sockcmd_dat_version
sockcmd_dat_version_t
;
#ifdef __CLSYNC_
GLOB
_H
#ifdef __CLSYNC_
CTX
_H
struct
sockcmd_dat_info
{
char
config_block
[
1
<<
8
];
char
label
[
1
<<
8
];
...
...
sync.c
View file @
1c3ce8c
This diff is collapsed. Click to expand it.
sync.h
View file @
1c3ce8c
...
...
@@ -17,6 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
extern
int
sync_run
(
struct
glob
*
glob
);
extern
int
sync_run
(
struct
ctx
*
ctx
);
extern
int
sync_term
(
int
exitcode
);
...
...
Please
register
or
login
to post a comment