#include <sys/socket.h>
#include <sys/un.h>
#include "citadel.h"
+#include "include/citadel_dirs.h"
{
int a;
int watchdog = 60;
- char *ctdl_home_directory = CTDLDIR;
char buf[SIZ];
int xfermode = 0;
+ int relh=0;
+ int home=0;
+ char relhome[PATH_MAX]="";
+ char ctdldir[PATH_MAX]=CTDLDIR;
/* Parse command line */
while ((a = getopt(argc, argv, "h:w:")) != EOF) {
switch (a) {
case 'h':
- ctdl_home_directory = strdup(optarg);
+ strcpy(relhome, optarg);
break;
case 'w':
watchdog = atoi(optarg);
}
}
- fprintf(stderr, "sendcommand: started (pid=%d) connecting to Citadel server in %s\n",
+ calc_dirs_n_files(relh, home, relhome, ctdldir, 0);
+
+ fprintf(stderr, "sendcommand: started (pid=%d) connecting to Citadel server at %s\n",
(int) getpid(),
- ctdl_home_directory
+ file_citadel_admin_socket
);
fflush(stderr);
alarm(watchdog);
- snprintf(buf, sizeof buf, "%s/citadel-admin.socket", ctdl_home_directory);
- serv_sock = uds_connectsock(buf);
+ serv_sock = uds_connectsock(file_citadel_admin_socket);
serv_gets(buf);
fprintf(stderr, "%s\n", buf);