diff options
author | Sami Kerola | 2017-02-11 21:23:26 +0100 |
---|---|---|
committer | Karel Zak | 2017-02-20 12:58:49 +0100 |
commit | 87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3 (patch) | |
tree | 513541cfa347d7fc66e50137603489cb195c86de /sys-utils/rtcwake.c | |
parent | cfdisk: avoid use of VLA in combination with sizeof() [smatch scan] (diff) | |
download | kernel-qcow2-util-linux-87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3.tar.gz kernel-qcow2-util-linux-87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3.tar.xz kernel-qcow2-util-linux-87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3.zip |
misc: do not use plain 0 as NULL [smatch scan]
text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer
Since many 'struct option' has used zero as NULL make them more readable in
same go by reindenting, and using named argument requirements.
Reference: https://lwn.net/Articles/93577/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/rtcwake.c')
-rw-r--r-- | sys-utils/rtcwake.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c index 11f75ae9b..de0ac4d85 100644 --- a/sys-utils/rtcwake.c +++ b/sys-utils/rtcwake.c @@ -168,7 +168,7 @@ static int get_basetimes(struct rtcwake_control *ctl, int fd) return -1; } - ctl->sys_time = time(0); + ctl->sys_time = time(NULL); if (ctl->sys_time == (time_t)-1) { warn(_("read system time failed")); return -1; @@ -413,21 +413,21 @@ int main(int argc, char **argv) OPT_LIST }; static const struct option long_options[] = { - {"adjfile", required_argument, 0, 'A'}, - {"auto", no_argument, 0, 'a'}, - {"dry-run", no_argument, 0, 'n'}, - {"local", no_argument, 0, 'l'}, - {"utc", no_argument, 0, 'u'}, - {"verbose", no_argument, 0, 'v'}, - {"version", no_argument, 0, 'V'}, - {"help", no_argument, 0, 'h'}, - {"mode", required_argument, 0, 'm'}, - {"device", required_argument, 0, 'd'}, - {"seconds", required_argument, 0, 's'}, - {"time", required_argument, 0, 't'}, - {"date", required_argument, 0, OPT_DATE}, - {"list-modes", no_argument, 0, OPT_LIST}, - {0, 0, 0, 0 } + { "adjfile", required_argument, NULL, 'A' }, + { "auto", no_argument, NULL, 'a' }, + { "dry-run", no_argument, NULL, 'n' }, + { "local", no_argument, NULL, 'l' }, + { "utc", no_argument, NULL, 'u' }, + { "verbose", no_argument, NULL, 'v' }, + { "version", no_argument, NULL, 'V' }, + { "help", no_argument, NULL, 'h' }, + { "mode", required_argument, NULL, 'm' }, + { "device", required_argument, NULL, 'd' }, + { "seconds", required_argument, NULL, 's' }, + { "time", required_argument, NULL, 't' }, + { "date", required_argument, NULL, OPT_DATE }, + { "list-modes", no_argument, NULL, OPT_LIST }, + { NULL, 0, NULL, 0 } }; static const ul_excl_t excl[] = { { 'a', 'l', 'u' }, |