Print this page
3244 utmpd.c: fix uninitialized variable, ret_val and other gcc warnings

@@ -17,10 +17,14 @@
  * information: Portions Copyright [yyyy] [name of copyright owner]
  *
  * 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.
  */
 
 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */

@@ -175,12 +179,11 @@
 /*
  * main()  - Main does basic setup and calls wait_for_pids() to do the work
  */
 
 int
-main(argc, argv)
-        char **argv;
+main(int argc, char *argv[])
 {
         char *defp;
         struct rlimit rlim;
         int i;
         time_t curtime, now;

@@ -347,11 +350,11 @@
 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 */
 
         /*