mirror of
https://github.com/troglobit/finit.git
synced 2026-10-07 08:04:22 +07:00
Fix GCC warnings with _FORTIFY_SOURCE=2
- Decleare some return values with (void)fn(), for cases where we don't care (dropping table headers), or best effor - Check return value from fgets() and chdir() in some cases that are valid, i.e., continuing execution is pointless Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+4
-2
@@ -58,7 +58,9 @@ static void do_list(const char *path)
|
||||
glob_t gl;
|
||||
size_t i;
|
||||
|
||||
chdir(path);
|
||||
if (chdir(path))
|
||||
return;
|
||||
|
||||
if (glob("*.conf", 0, NULL, &gl))
|
||||
return;
|
||||
|
||||
@@ -213,7 +215,7 @@ int do_disable(char *arg, int check)
|
||||
|
||||
if (chdir(FINIT_RCSD))
|
||||
err(1, "failed cd %s", FINIT_RCSD);
|
||||
chdir("enabled"); /* System *may* have enabled/ dir. */
|
||||
(void)chdir("enabled"); /* System *may* have enabled/ dir. */
|
||||
|
||||
if (check && stat(arg, &st))
|
||||
errx(1, "%s not (an) enabled (service).", arg);
|
||||
|
||||
Reference in New Issue
Block a user