Add #ifdef in bootlogd.c to avoid gcc warnings about unused variable on non-linux...
authorPetter Reinholdtsen <pere@hungry.com>
Tue, 27 Apr 2010 19:43:17 +0000 (19:43 +0000)
committerPetter Reinholdtsen <pere@hungry.com>
Tue, 27 Apr 2010 19:43:17 +0000 (19:43 +0000)
git-svn-id: svn://svn.sv.gnu.org/sysvinit/sysvinit/trunk@71 456724a4-4300-0410-8514-c89748c515a2

doc/Changelog
src/bootlogd.c

index c20bfcebe9617aab9f2ddb50b8a0bad6ccead503..04b3bdbae216676a4e1952598c8194f5e9a15887 100644 (file)
@@ -7,6 +7,8 @@ sysvinit (2.89dsf) UNRELEASED; urgency=low
 
   [ Petter Reinholdtsen ]
   * Next release will be 2.89dsf.
+  * Add #ifdef in bootlogd.c to avoid gcc warnings about unused
+    variable on non-linux platforms.
 
  -- Petter Reinholdtsen <pere@hungry.com>  Sun Apr 11 11:28:55 CEST 2010
 
index 570d3822bf117f5ee16711ccfcfa2e4beb7e1af0..3a12f3da890e074506fe4942575b79ab1c3d1517 100644 (file)
@@ -243,12 +243,16 @@ int consolename(char *res, int rlen)
 #ifdef TIOCGDEV
        unsigned int    kdev;
 #endif
-       struct stat     st, st2;
+       struct stat     st;
+       int             n;
+#ifdef __linux__
        char            buf[256];
        char            *p;
+       struct stat     st2;
        int             didmount = 0;
-       int             n, r;
+       int             r;
        int             fd;
+#endif
 
        fstat(0, &st);
        if (major(st.st_rdev) != 5 || minor(st.st_rdev) != 1) {