Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xinstall pacify gcc-2.8 uninitialized variable warni...



details:   https://anonhg.NetBSD.org/src/rev/56c829079fbb
branches:  trunk
changeset: 474442:56c829079fbb
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jul 06 14:45:31 1999 +0000

description:
pacify gcc-2.8 uninitialized variable warnings, and only use timespecs in
struct stat on BSD4_4 systems.

diffstat:

 usr.bin/xinstall/xinstall.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (50 lines):

diff -r ab930b5f24c4 -r 56c829079fbb usr.bin/xinstall/xinstall.c
--- a/usr.bin/xinstall/xinstall.c       Tue Jul 06 14:39:56 1999 +0000
+++ b/usr.bin/xinstall/xinstall.c       Tue Jul 06 14:45:31 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xinstall.c,v 1.36 1999/06/26 00:41:39 thorpej Exp $    */
+/*     $NetBSD: xinstall.c,v 1.37 1999/07/06 14:45:31 christos Exp $   */
 
 /*
  * Copyright (c) 1987, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) 7/21/93";
 #else
-__RCSID("$NetBSD: xinstall.c,v 1.36 1999/06/26 00:41:39 thorpej Exp $");
+__RCSID("$NetBSD: xinstall.c,v 1.37 1999/07/06 14:45:31 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -386,6 +386,7 @@
                        *ptr = '\0';
                        dir = to_name;
                } else {
+                       c = '\0';       /* pacify gcc */
                        dir = tmpl;
                        *dir = '\0';
                }
@@ -396,6 +397,7 @@
                to_name = tmpl;
 
        } else {
+               oto_name = NULL;        /* pacify gcc */
                if (dobackup)
                        backup(to_name);
                else
@@ -468,8 +470,15 @@
        if (dopreserve) {
                struct timeval tv[2];
 
+#ifdef BSD4_4
                TIMESPEC_TO_TIMEVAL(&tv[0], &from_sb.st_atimespec);
                TIMESPEC_TO_TIMEVAL(&tv[1], &from_sb.st_mtimespec);
+#else
+               tv[0].tv_sec = from_sb.st_atime;
+               tv[0].tv_usec = 0;
+               tv[1].tv_sec = from_sb.st_mtime;
+               tv[1].tv_usec = 0;
+#endif
                if (futimes(to_fd, tv) == -1)
                        warn("%s: futimes", to_name);
        }



Home | Main Index | Thread Index | Old Index