diff options
author | Nikos Mavrogiannopoulos <nmav@crystal.(none)> | 2008-11-21 21:45:46 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@crystal.(none)> | 2008-11-21 21:45:46 +0200 |
commit | b0579b6478f904bf58d1636f5633a094ad388a8a (patch) | |
tree | 0930347d6ea0112fca6ff99759d75847ecaf222a /src | |
parent | aeb71450eccbbb15eab3216fa6e6692605ec37cb (diff) | |
download | gnutls-b0579b6478f904bf58d1636f5633a094ad388a8a.tar.gz |
return non zero error code on error conditions.
Diffstat (limited to 'src')
-rw-r--r-- | src/cli.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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 |