git://git.onelab.eu
/
vsys-wrappers.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Switch to production version of vsys
[vsys-wrappers.git]
/
fuse
/
reroutemount.c
diff --git
a/fuse/reroutemount.c
b/fuse/reroutemount.c
index
575554b
..
c1c140b
100644
(file)
--- a/
fuse/reroutemount.c
+++ b/
fuse/reroutemount.c
@@
-7,6
+7,7
@@
#include "fdpass.h"
char *socket_name = "/vsys/fd_fusemount.control";
#include "fdpass.h"
char *socket_name = "/vsys/fd_fusemount.control";
+
unsigned int arg_length = 128;
void send_argument(int control_channel_fd, const char *source) {
unsigned int arg_length = 128;
void send_argument(int control_channel_fd, const char *source) {
@@
-24,6
+25,7
@@
int connect_socket() {
addr.sun_family = AF_UNIX;
strcpy( addr.sun_path, socket_name );
int len = strlen(socket_name) + sizeof(addr.sun_family);
addr.sun_family = AF_UNIX;
strcpy( addr.sun_path, socket_name );
int len = strlen(socket_name) + sizeof(addr.sun_family);
+ printf("Connecting to %s\n", socket_name);
assert( connect( fd, (struct sockaddr *) &addr, len ) == 0 );
return fd;
}
assert( connect( fd, (struct sockaddr *) &addr, len ) == 0 );
return fd;
}
@@
-53,6
+55,7
@@
int mount(const char *source, const char *target, const char *filesystemtype,
unsigned long mountflags, const void *data) {
int fd = connect_socket();
int old_fuse_fd, new_fuse_fd;
unsigned long mountflags, const void *data) {
int fd = connect_socket();
int old_fuse_fd, new_fuse_fd;
+ int dupfd;
char buf[1024];
char buf[1024];
@@
-77,8
+80,8
@@
int mount(const char *source, const char *target, const char *filesystemtype,
exit(1);
}
exit(1);
}
- if(
dup2(new_fuse_fd, old_fuse_fd ) != new
_fuse_fd ) {
- printf ("Could not duplicate returned file descriptor
\n"
);
+ if(
(dupfd=dup2(new_fuse_fd, old_fuse_fd )) != old
_fuse_fd ) {
+ printf ("Could not duplicate returned file descriptor
: %d\n",dupfd
);
exit(1);
}
exit(1);
}