The manual of glob(3) says that the function returns 0 on successful
completion. Any other integer value should be considered an error, not
only negative integers.
In practice, *BSD systems use negative values but Linux uses positive
integers.
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
asprintf(&thermal_zone, THERMAL_ZONE, zone);
else {
static glob_t globbuf;
- if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) < 0)
+ if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) != 0)
die("glob() failed\n");
if (globbuf.gl_pathc == 0) {
/* No glob matches, the specified path does not contain a wildcard. */
static glob_t globbuf;
memset(pidbuf, 0, sizeof(pidbuf));
- if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) < 0)
+ if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) != 0)
die("glob() failed\n");
if (globbuf.gl_pathc == 0) {
/* No glob matches, the specified path does not contain a wildcard. */