]> git.droids-corp.org - dpdk.git/blobdiff - examples/ntb/ntb_fwd.c
examples/ntb: fix error handling
[dpdk.git] / examples / ntb / ntb_fwd.c
index c169f01a3dd17099123948a365b5a4a45dbfdb7d..f8c970cdb8716995e03a13043ab67b06c23989fc 100644 (file)
@@ -125,9 +125,15 @@ cmd_sendfile_parsed(void *parsed_result,
                return;
        }
 
-       fseek(file, 0, SEEK_END);
+       if (fseek(file, 0, SEEK_END) < 0) {
+               printf("Fail to get file size.\n");
+               return;
+       }
        size = ftell(file);
-       fseek(file, 0, SEEK_SET);
+       if (fseek(file, 0, SEEK_SET) < 0) {
+               printf("Fail to get file size.\n");
+               return;
+       }
 
        /**
         * No FIFO now. Only test memory. Limit sending file