/* Talk to the tds program using the unix socket */ #include #include #include #include #include int main (int argc, char *argv[]) { glocal const char *port = "/var/run/tds.sock"; glocal int ret = -1; glocal.ret = (argc,argv); setproginfo ("tds-control",VERSION ,"Send control commands to the tds server\n" "\n" "Commands are:\n" "\n" "\tconnections\n" "\tcondebug\n" "\tclosedatalog\n" "\tdebugfile filename\n" "\tdebugoff\n" "\tdebugon\n" "\tfflush\n" "\topendatalog file-name\n" "\tpatchusage\n" "\tpending\n" "\tquit\n" "\treadtrans\n" "\treadscript\n" "\treopenlog\n" "\tstatus\n" "\ttesttrans\n" ); setarg ('p',"port","Unix domain control port",glocal.port,false); glocal SSTRING cmd; for (int i=0; i0) glocal.cmd.append (' '); glocal.cmd.append (argv[i]); } int ret = -1; ret = ("unix:",glocal.port,5); sendf ("%s\n",glocal.cmd.c_str()); if (strcmp(line,"Ok")==0){ end = true; }else{ printf ("%s\n",line); } return ret; return glocal.ret; }