mirror of
https://github.com/troglobit/finit.git
synced 2026-10-14 10:19:36 +00: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:
1 parent
774a24cdd8
commit
3ed291789c
5 files changed
+13
-10
No files matched your search
+3
-3
@@ -432,14 +432,14 @@ void set_hostname(char **hostname)
|
||||
return;
|
||||
}
|
||||
|
||||
fgets(*hostname, st.st_size, fp);
|
||||
chomp(*hostname);
|
||||
if (fgets(*hostname, st.st_size, fp))
|
||||
chomp(*hostname);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
done:
|
||||
if (*hostname)
|
||||
sethostname(*hostname, strlen(*hostname));
|
||||
(void)sethostname(*hostname, strlen(*hostname));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user