#include <sys/un.h>
#include "fdpass.h"
-char *socket_name = "/vsys/fd_fusemount.control";
+//char *socket_name = "/vsys/fd_fusemount.control";
+char *socket_name = "/foo";
unsigned int arg_length = 128;
void send_argument(int control_channel_fd, const char *source) {
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;
}
unsigned long mountflags, const void *data) {
int fd = connect_socket();
int old_fuse_fd, new_fuse_fd;
+ int dupfd;
char buf[1024];
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);
}