struct cli_state *cli = NULL;
cli = cli_initialise(NULL);
- if (!cli || !cli_connect(cli, host, ip)) goto done;
+ if (!cli) goto done;
+
+ if (!cli_connect(cli, host, ip)) {
+ fprintf(stderr,"Can't contact server\n");
+ goto done;
+ }
make_nmb_name(&calling, global_myname, 0x0);
if (host) {
make_nmb_name(&called, "*SMBSERVER", 0x20);
}
- if (!cli_session_request(cli, &calling, &called)) goto done;
- if (!cli_negprot(cli)) goto done;
+ if (!cli_session_request(cli, &calling, &called)) {
+ fprintf(stderr,"Session request failed\n");
+ goto done;
+ }
+ if (!cli_negprot(cli)) {
+ fprintf(stderr,"Protocol negotiation failed\n");
+ goto done;
+ }
ret = cli->servertime;
time_t t = nettime();
char *cmd;
- if (t == 0) {
- d_printf("Can't contact server\n");
- return -1;
- }
+ if (t == 0) return -1;
/* yes, I know this is cheesy. Use "net time system" if you want to
roll your own. I'm putting this in as it works on a large number
{
time_t t = nettime();
- if (t == 0) {
- d_printf("Can't contact server\n");
- return -1;
- }
+ if (t == 0) return -1;
printf("%s\n", systime(t));
/* default - print the time */
t = cli_servertime(opt_host, opt_have_ip? &opt_dest_ip : NULL);
+ if (t == 0) return -1;
d_printf("%s", ctime(&t));
return 0;