vhost: use int to store getopt() return value

getopt() returns int, not char, so assigning the return value into a
char will truncate it.

Fixes a warning on platforms where char is unsigned:

  vhost.c:109:61: warning: comparison is always true due to limited
  range of data type [-Wtype-limits]

Change-Id: I3a290096346db241a473434952e0f5fd69e98c2f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/386347
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2017-11-08 16:42:56 -07:00 committed by Jim Harris
parent d544d14494
commit 6a0e6abcd3

View File

@ -98,7 +98,7 @@ int
main(int argc, char *argv[])
{
struct spdk_app_opts opts = {};
char ch;
int ch;
int rc;
const char *socket_path = NULL;
enum spdk_log_level print_level = SPDK_LOG_NOTICE;