diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-05-27 16:52:34 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-06-17 20:47:37 +0200 |
commit | 0ccc614c7d1b74f34abeeee34fe1e5f11820f39c (patch) | |
tree | 1e42506a542a0757c7b9d7cd94e7fed1d04eac3c /examples/new.c | |
parent | 02eb90375d9975252647ac285d0ba9fa61435640 (diff) | |
download | cryptodev-linux-0ccc614c7d1b74f34abeeee34fe1e5f11820f39c.tar.gz cryptodev-linux-0ccc614c7d1b74f34abeeee34fe1e5f11820f39c.tar.xz cryptodev-linux-0ccc614c7d1b74f34abeeee34fe1e5f11820f39c.zip |
Corrected nasty bug and added some debugging info.
Diffstat (limited to 'examples/new.c')
-rw-r--r-- | examples/new.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/new.c b/examples/new.c index 60f9437..1f507be 100644 --- a/examples/new.c +++ b/examples/new.c @@ -46,6 +46,8 @@ test_ncr_data(int cfd) perror("ioctl(NCRIO_DATA_INIT)"); return 1; } + + fprintf(stderr, "Imported data\n"); memset(data, 0, sizeof(data)); @@ -64,6 +66,8 @@ test_ncr_data(int cfd) return 1; } + fprintf(stderr, "Verified imported data integrity\n"); + /* test set */ memset(data, 0xf1, sizeof(data)); @@ -77,6 +81,8 @@ test_ncr_data(int cfd) return 1; } + fprintf(stderr, "Imported new data\n"); + /* test get after set */ memset(data, 0, sizeof(data)); @@ -96,6 +102,7 @@ test_ncr_data(int cfd) return 1; } } + fprintf(stderr, "Verified new data\n"); return 0; /* ok */ } @@ -103,7 +110,7 @@ test_ncr_data(int cfd) int main() { - int fd = -1, cfd = -1; + int fd = -1; /* Open the crypto device */ fd = open("/dev/crypto", O_RDWR, 0); @@ -113,7 +120,7 @@ main() } /* Run the test itself */ - if (test_ncr_data(cfd)) + if (test_ncr_data(fd)) return 1; /* Close the original descriptor */ |