summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@crystal.(none)>2008-11-21 21:45:46 +0200
committerNikos Mavrogiannopoulos <nmav@crystal.(none)>2008-11-21 21:45:46 +0200
commitb0579b6478f904bf58d1636f5633a094ad388a8a (patch)
tree0930347d6ea0112fca6ff99759d75847ecaf222a /src
parentaeb71450eccbbb15eab3216fa6e6692605ec37cb (diff)
downloadgnutls-b0579b6478f904bf58d1636f5633a094ad388a8a.tar.gz
return non zero error code on error conditions.
Diffstat (limited to 'src')
-rw-r--r--src/cli.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cli.c b/src/cli.c
index 9749c56d01..2b46992d92 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -571,7 +571,7 @@ main (int argc, char **argv)
fd_set rset;
int maxfd;
struct timeval tv;
- int user_term = 0;
+ int user_term = 0, retval = 0;
socket_st hd;
set_program_name (argv[0]);
@@ -653,8 +653,6 @@ main (int argc, char **argv)
printf ("*** This is a resumed session\n");
}
-
-
if (resume != 0 && i == 0)
{
@@ -715,6 +713,7 @@ after_handshake:
{
fprintf (stderr, "*** Handshake has failed\n");
user_term = 1;
+ retval = 1;
break;
}
}
@@ -745,6 +744,7 @@ after_handshake:
{
fprintf (stderr,
"*** Server has terminated the connection abnormally.\n");
+ retval = 1;
break;
}
else if (ret > 0)
@@ -778,6 +778,7 @@ after_handshake:
{
fprintf (stderr, "*** Handshake has failed\n");
user_term = 1;
+ retval = 1;
break;
}
}
@@ -834,7 +835,7 @@ after_handshake:
gnutls_global_deinit ();
- return 0;
+ return retval;
}
void