diff options
author | Shruti Sampat <shrutisampat@gmail.com> | 2014-11-27 00:43:05 +0530 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2014-12-23 15:09:04 -0800 |
commit | fd64a0d03455fdb3bbf710e77f2a2f6d08d3cf6c (patch) | |
tree | 843afceb2839f5f77f839ca69d21b75c00b8cb35 /usr/src/cmd | |
parent | 5422785d352a2bb398daceab3d1898a8aa64d006 (diff) | |
download | illumos-gate-fd64a0d03455fdb3bbf710e77f2a2f6d08d3cf6c.tar.gz |
3244 utmpd.c: fix uninitialized variable, ret_val and other gcc warnings
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Sachidananda Urs <sac.urs@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/cmd')
-rw-r--r-- | usr/src/cmd/utmpd/Makefile | 4 | ||||
-rw-r--r-- | usr/src/cmd/utmpd/utmpd.c | 15 |
2 files changed, 10 insertions, 9 deletions
diff --git a/usr/src/cmd/utmpd/Makefile b/usr/src/cmd/utmpd/Makefile index f1b2a4222e..611c1f36dd 100644 --- a/usr/src/cmd/utmpd/Makefile +++ b/usr/src/cmd/utmpd/Makefile @@ -18,7 +18,7 @@ # # CDDL HEADER END # -# +# Copyright 2014 Shruti V Sampat <shrutisampat@gmail.com> # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -34,8 +34,6 @@ ROOTMANIFESTDIR = $(ROOTSVCSYSTEM) FILEMODE = 555 -CERRWARN += -_gcc=-Wno-extra - .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/utmpd/utmpd.c b/usr/src/cmd/utmpd/utmpd.c index fde5d01f93..ba23b04aa5 100644 --- a/usr/src/cmd/utmpd/utmpd.c +++ b/usr/src/cmd/utmpd/utmpd.c @@ -19,6 +19,10 @@ * CDDL HEADER END */ /* + * Copyright 2014 Shruti V Sampat <shrutisampat@gmail.com> + */ + +/* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -177,8 +181,7 @@ static void warn_utmp(void); */ int -main(argc, argv) - char **argv; +main(int argc, char *argv[]) { char *defp; struct rlimit rlim; @@ -189,7 +192,7 @@ main(argc, argv) if (getuid() != 0) { (void) fprintf(stderr, - "You must be root to run this program\n"); + "You must be root to run this program\n"); fatal("You must be root to run this program"); } @@ -199,9 +202,9 @@ main(argc, argv) Debug = 1; } else { (void) fprintf(stderr, - "%s: Wrong number of arguments\n", prog_name); + "%s: Wrong number of arguments\n", prog_name); (void) fprintf(stderr, - "Usage: %s [-debug]\n", prog_name); + "Usage: %s [-debug]\n", prog_name); exit(2); } } @@ -349,7 +352,7 @@ wait_for_pids() register struct pollfd *pfd; register int i; pid_t pid; - int ret_val; + int ret_val = 0; int timeout; static time_t last_timeout = 0; static int bad_error = 0; /* Count of POLL errors */ |