diff options
author | Imre Deak <imre.deak@intel.com> | 2012-10-10 16:04:44 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-10-10 15:59:17 +0200 |
commit | 0bf5fd894c386cbb6a2419056e43d400c4dec73b (patch) | |
tree | a950fc1f4a1bdb700bf2ee67b330ffc94778cebd /tests | |
parent | bcfc0f1e4b15dac830c1f7d61b2cca3c74b3ba69 (diff) |
fix warn in prime_nv_*: ignoring return value of ‘fgets’
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/prime_nv_api.c | 5 | ||||
-rw-r--r-- | tests/prime_nv_test.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/tests/prime_nv_api.c b/tests/prime_nv_api.c index 962e903d..e1b7117f 100644 --- a/tests/prime_nv_api.c +++ b/tests/prime_nv_api.c @@ -38,6 +38,8 @@ static int find_and_open_devices(void) char vendor_id[8]; int venid; for (i = 0; i < 9; i++) { + char *ret; + sprintf(path, "/sys/class/drm/card%d/device/vendor", i); if (stat(path, &buf)) break; @@ -46,7 +48,8 @@ static int find_and_open_devices(void) if (!fl) break; - fgets(vendor_id, 8, fl); + ret = fgets(vendor_id, 8, fl); + assert(ret); fclose(fl); venid = strtoul(vendor_id, NULL, 16); diff --git a/tests/prime_nv_test.c b/tests/prime_nv_test.c index 2269f84f..f9a766a1 100644 --- a/tests/prime_nv_test.c +++ b/tests/prime_nv_test.c @@ -46,6 +46,8 @@ static int find_and_open_devices(void) char vendor_id[8]; int venid; for (i = 0; i < 9; i++) { + char *ret; + sprintf(path, "/sys/class/drm/card%d/device/vendor", i); if (stat(path, &buf)) break; @@ -54,7 +56,8 @@ static int find_and_open_devices(void) if (!fl) break; - fgets(vendor_id, 8, fl); + ret = fgets(vendor_id, 8, fl); + assert(ret); fclose(fl); venid = strtoul(vendor_id, NULL, 16); |