Standardize error checking for strtol calls
authorBryce Harrington <bryce@osg.samsung.com>
Thu, 4 Aug 2016 00:40:48 +0000 (17:40 -0700)
committerBryce Harrington <bryce@osg.samsung.com>
Sun, 7 Aug 2016 01:19:01 +0000 (18:19 -0700)
commit913d7c15f79da33aa97100286df5d8f88731e252
tree28246100eacf75f3807675818cea8196448cfe65
parent295e9d004eac2d2e2381ac214892694b90f95639
Standardize error checking for strtol calls

This tightens up the strtol() error checking in several places where it
is used for parsing environment variables, and in the backlight
interface that is reading numbers from files under /sys/class/backlight.
All of these uses are expecting strings containing decimal numbers and
nothing else, so the error checking can all be tightened up and made
consistent with other strtol() calls.

This follows the error checking style used in Wayland
(c.f. wayland-client.c and scanner.c) and c.f. commit cbc05378.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
compositor/main.c
compositor/systemd-notify.c
libweston/compositor.c
libweston/libbacklight.c