PATCH: 2.4.0-test10-pre5 mktime name collision fix

From: Adam J. Richter (adam@yggdrasil.com)
Date: Wed Oct 25 2000 - 01:35:42 EST


        2.4.0-test9 consolidated all of the duplicative declarations
of mktime from various include/asm-.../ files into include/linux/time.h.
This was the right thing to do, but a lot of C code includes <linux/time.h>,
mostly older code, like the libc5 sources. This causes compiles of
the effected code to error out due to a collision with the C library
function by the same name.

        The following patch simply renames "mktime" to the unused name
"maketime" everywhere, including comments (one exception: this patch
deletes an unused "struct mktime;" line in include/asm-m68k/machdep.h).

        Linus, could you please apply this patch? Thanks in advance.
 
Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."

diff -u -r linux-2.4.0-test10-pre5/arch/alpha/kernel/time.c linux/arch/alpha/kernel/time.c
--- linux-2.4.0-test10-pre5/arch/alpha/kernel/time.c Fri Sep 22 14:09:00 2000
+++ linux/arch/alpha/kernel/time.c Tue Oct 24 23:21:22 2000
@@ -6,7 +6,7 @@
  * This file contains the PC-specific time handling details:
  * reading the RTC at bootup, etc..
  * 1994-07-02 Alan Modra
- * fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime
+ * fixed set_rtc_mmss, fixed time.year for >= 2000, new maketime
  * 1995-03-26 Markus Kuhn
  * fixed 500 ms bug at call to set_rtc_mmss, fixed DS12887
  * precision CMOS clock update
@@ -250,7 +250,7 @@
         if ((year += epoch) < 1970)
                 year += 100;
 
- xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
+ xtime.tv_sec = maketime(year, mon, day, hour, min, sec);
         xtime.tv_usec = 0;
 
         if (HZ > (1<<16)) {
diff -u -r linux-2.4.0-test10-pre5/arch/arm/kernel/time.c linux/arch/arm/kernel/time.c
--- linux-2.4.0-test10-pre5/arch/arm/kernel/time.c Mon Sep 18 15:15:25 2000
+++ linux/arch/arm/kernel/time.c Tue Oct 24 23:21:23 2000
@@ -12,7 +12,7 @@
  * reading the RTC at bootup, etc...
  *
  * 1994-07-02 Alan Modra
- * fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime
+ * fixed set_rtc_mmss, fixed time.year for >= 2000, new maketime
  * 1998-12-20 Updated NTP code according to technical memorandum Jan '96
  * "A Kernel Model for Precision Timekeeping" by Dave Mills
  */
diff -u -r linux-2.4.0-test10-pre5/arch/i386/kernel/time.c linux/arch/i386/kernel/time.c
--- linux-2.4.0-test10-pre5/arch/i386/kernel/time.c Tue Oct 24 23:16:58 2000
+++ linux/arch/i386/kernel/time.c Tue Oct 24 23:21:22 2000
@@ -6,7 +6,7 @@
  * This file contains the PC-specific time handling details:
  * reading the RTC at bootup, etc..
  * 1994-07-02 Alan Modra
- * fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime
+ * fixed set_rtc_mmss, fixed time.year for >= 2000, new maketime
  * 1995-03-26 Markus Kuhn
  * fixed 500 ms bug at call to set_rtc_mmss, fixed DS12887
  * precision CMOS clock update
@@ -541,7 +541,7 @@
           }
         if ((year += 1900) < 1970)
                 year += 100;
- return mktime(year, mon, day, hour, min, sec);
+ return maketime(year, mon, day, hour, min, sec);
 }
 
 static struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL};
diff -u -r linux-2.4.0-test10-pre5/arch/ia64/kernel/efi.c linux/arch/ia64/kernel/efi.c
--- linux-2.4.0-test10-pre5/arch/ia64/kernel/efi.c Tue Oct 24 23:16:58 2000
+++ linux/arch/ia64/kernel/efi.c Tue Oct 24 23:21:23 2000
@@ -108,7 +108,7 @@
         if ((*efi.get_time)(&tm, 0) != EFI_SUCCESS)
                 return;
 
- tv->tv_sec = mktime(tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second);
+ tv->tv_sec = maketime(tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second);
         tv->tv_usec = tm.nanosecond / 1000;
 }
 
diff -u -r linux-2.4.0-test10-pre5/arch/m68k/kernel/time.c linux/arch/m68k/kernel/time.c
--- linux-2.4.0-test10-pre5/arch/m68k/kernel/time.c Mon Sep 11 08:39:48 2000
+++ linux/arch/m68k/kernel/time.c Tue Oct 24 23:21:22 2000
@@ -113,7 +113,7 @@
 
         if ((year += 1900) < 1970)
                 year += 100;
- xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
+ xtime.tv_sec = maketime(year, mon, day, hour, min, sec);
         xtime.tv_usec = 0;
 
         mach_sched_init(timer_interrupt);
diff -u -r linux-2.4.0-test10-pre5/arch/m68k/mac/misc.c linux/arch/m68k/mac/misc.c
--- linux-2.4.0-test10-pre5/arch/m68k/mac/misc.c Mon Sep 11 08:39:48 2000
+++ linux/arch/m68k/mac/misc.c Tue Oct 24 23:29:12 2000
@@ -624,7 +624,7 @@
                         t->year + 1900, t->mon + 1, t->day, t->hour, t->min, t->sec);
 
 #if 0 /* it trashes my rtc */
- now = mktime(t->year + 1900, t->mon + 1, t->day,
+ now = maketime(t->year + 1900, t->mon + 1, t->day,
                              t->hour, t->min, t->sec);
 
                 if (macintosh_config->adb_type == MAC_ADB_II) {
diff -u -r linux-2.4.0-test10-pre5/arch/mips/dec/time.c linux/arch/mips/dec/time.c
--- linux-2.4.0-test10-pre5/arch/mips/dec/time.c Tue Oct 24 23:16:58 2000
+++ linux/arch/mips/dec/time.c Tue Oct 24 23:21:22 2000
@@ -432,7 +432,7 @@
         year += 1928;
 
         write_lock_irq(&xtime_lock);
- xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
+ xtime.tv_sec = maketime(year, mon, day, hour, min, sec);
         xtime.tv_usec = 0;
         write_unlock_irq(&xtime_lock);
 
diff -u -r linux-2.4.0-test10-pre5/arch/mips/kernel/time.c linux/arch/mips/kernel/time.c
--- linux-2.4.0-test10-pre5/arch/mips/kernel/time.c Tue Oct 24 23:16:58 2000
+++ linux/arch/mips/kernel/time.c Tue Oct 24 23:21:22 2000
@@ -535,7 +535,7 @@
         year += epoch;
 
         write_lock_irq (&xtime_lock);
- xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
+ xtime.tv_sec = maketime(year, mon, day, hour, min, sec);
         xtime.tv_usec = 0;
         write_unlock_irq (&xtime_lock);
 
diff -u -r linux-2.4.0-test10-pre5/arch/mips/sgi/kernel/indy_timer.c linux/arch/mips/sgi/kernel/indy_timer.c
--- linux-2.4.0-test10-pre5/arch/mips/sgi/kernel/indy_timer.c Tue Oct 24 23:16:58 2000
+++ linux/arch/mips/sgi/kernel/indy_timer.c Tue Oct 24 23:21:22 2000
@@ -191,7 +191,7 @@
         if ((year += 1940) < 1970)
                 year += 100;
 
- return mktime(year, mon, day, hour, min, sec);
+ return maketime(year, mon, day, hour, min, sec);
 }
 
 #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
diff -u -r linux-2.4.0-test10-pre5/arch/mips64/sgi-ip22/ip22-timer.c linux/arch/mips64/sgi-ip22/ip22-timer.c
--- linux-2.4.0-test10-pre5/arch/mips64/sgi-ip22/ip22-timer.c Tue Oct 24 23:16:58 2000
+++ linux/arch/mips64/sgi-ip22/ip22-timer.c Tue Oct 24 23:21:23 2000
@@ -191,7 +191,7 @@
         if ((year += 1940) < 1970)
                 year += 100;
 
- return mktime(year, mon, day, hour, min, sec);
+ return maketime(year, mon, day, hour, min, sec);
 }
 
 #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
diff -u -r linux-2.4.0-test10-pre5/arch/mips64/sgi-ip27/ip27-timer.c linux/arch/mips64/sgi-ip27/ip27-timer.c
--- linux-2.4.0-test10-pre5/arch/mips64/sgi-ip27/ip27-timer.c Tue Oct 24 23:16:58 2000
+++ linux/arch/mips64/sgi-ip27/ip27-timer.c Tue Oct 24 23:21:23 2000
@@ -249,7 +249,7 @@
 
         year += 1970;
 
- return mktime(year, month, date, hour, min, sec);
+ return maketime(year, month, date, hour, min, sec);
 }
 
 extern void ioc3_eth_init(void);
diff -u -r linux-2.4.0-test10-pre5/arch/ppc/amiga/time.c linux/arch/ppc/amiga/time.c
--- linux-2.4.0-test10-pre5/arch/ppc/amiga/time.c Mon Sep 11 08:39:48 2000
+++ linux/arch/ppc/amiga/time.c Tue Oct 24 23:21:22 2000
@@ -23,7 +23,7 @@
         if ((year += 1900) < 1970)
                 year += 100;
 
- return mktime(year, mon, day, hour, min, sec);
+ return maketime(year, mon, day, hour, min, sec);
 }
 
 int m68k_set_rtc_time(unsigned long nowtime)
diff -u -r linux-2.4.0-test10-pre5/arch/ppc/kernel/chrp_time.c linux/arch/ppc/kernel/chrp_time.c
--- linux-2.4.0-test10-pre5/arch/ppc/kernel/chrp_time.c Sun Sep 17 09:48:06 2000
+++ linux/arch/ppc/kernel/chrp_time.c Tue Oct 24 23:21:22 2000
@@ -157,7 +157,7 @@
           }
         if ((year += 1900) < 1970)
                 year += 100;
- return mktime(year, mon, day, hour, min, sec);
+ return maketime(year, mon, day, hour, min, sec);
 }
 
 
diff -u -r linux-2.4.0-test10-pre5/arch/ppc/kernel/gemini_setup.c linux/arch/ppc/kernel/gemini_setup.c
--- linux-2.4.0-test10-pre5/arch/ppc/kernel/gemini_setup.c Sun Sep 17 09:48:06 2000
+++ linux/arch/ppc/kernel/gemini_setup.c Tue Oct 24 23:21:22 2000
@@ -393,7 +393,7 @@
                sec, min, hour, day, mon, year);
 #endif
 
- return mktime( year, mon, day, hour, min, sec );
+ return maketime( year, mon, day, hour, min, sec );
 }
 
 
diff -u -r linux-2.4.0-test10-pre5/arch/ppc/kernel/prep_time.c linux/arch/ppc/kernel/prep_time.c
--- linux-2.4.0-test10-pre5/arch/ppc/kernel/prep_time.c Sun Sep 17 09:48:07 2000
+++ linux/arch/ppc/kernel/prep_time.c Tue Oct 24 23:21:22 2000
@@ -140,7 +140,7 @@
         }
         if ((year += 1900) < 1970)
                 year += 100;
- return mktime(year, mon, day, hour, min, sec);
+ return maketime(year, mon, day, hour, min, sec);
 }
 
 __prep
@@ -216,5 +216,5 @@
                 year += 100;
         }
 
- return mktime(year, mon, day, hour, min, sec);
+ return maketime(year, mon, day, hour, min, sec);
 }
diff -u -r linux-2.4.0-test10-pre5/arch/sh/kernel/time.c linux/arch/sh/kernel/time.c
--- linux-2.4.0-test10-pre5/arch/sh/kernel/time.c Tue Oct 24 23:17:00 2000
+++ linux/arch/sh/kernel/time.c Tue Oct 24 23:21:23 2000
@@ -325,7 +325,7 @@
                 goto again;
         }
 
- return mktime(yr100 * 100 + yr, mon, day, hr, min, sec);
+ return maketime(yr100 * 100 + yr, mon, day, hr, min, sec);
 }
 
 static __init unsigned int get_cpu_mhz(void)
diff -u -r linux-2.4.0-test10-pre5/arch/sparc/kernel/time.c linux/arch/sparc/kernel/time.c
--- linux-2.4.0-test10-pre5/arch/sparc/kernel/time.c Sun Sep 17 10:01:49 2000
+++ linux/arch/sparc/kernel/time.c Tue Oct 24 23:21:22 2000
@@ -383,7 +383,7 @@
         day = MSTK_REG_DOM(mregs);
         mon = MSTK_REG_MONTH(mregs);
         year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
- xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
+ xtime.tv_sec = maketime(year, mon, day, hour, min, sec);
         xtime.tv_usec = 0;
         mregs->creg &= ~MSTK_CREG_READ;
 #ifdef CONFIG_SUN4
@@ -413,7 +413,7 @@
                 enable_pil_irq(10);
                 intersil_start(iregs);
 
- xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
+ xtime.tv_sec = maketime(year, mon, day, hour, min, sec);
                 xtime.tv_usec = 0;
                 printk("%u/%u/%u %u:%u:%u\n",day,mon,year,hour,min,sec);
         }
diff -u -r linux-2.4.0-test10-pre5/arch/sparc64/kernel/time.c linux/arch/sparc64/kernel/time.c
--- linux-2.4.0-test10-pre5/arch/sparc64/kernel/time.c Tue Oct 3 09:24:41 2000
+++ linux/arch/sparc64/kernel/time.c Tue Oct 24 23:21:22 2000
@@ -288,7 +288,7 @@
         day = MSTK_REG_DOM(mregs);
         mon = MSTK_REG_MONTH(mregs);
         year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
- xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
+ xtime.tv_sec = maketime(year, mon, day, hour, min, sec);
         xtime.tv_usec = 0;
 
         tmp = mostek_read(mregs + MOSTEK_CREG);
diff -u -r linux-2.4.0-test10-pre5/drivers/acorn/char/i2c.c linux/drivers/acorn/char/i2c.c
--- linux-2.4.0-test10-pre5/drivers/acorn/char/i2c.c Mon Sep 18 15:15:21 2000
+++ linux/drivers/acorn/char/i2c.c Tue Oct 24 23:21:22 2000
@@ -25,7 +25,7 @@
 #include "pcf8583.h"
 
 extern unsigned long
-mktime(unsigned int year, unsigned int mon, unsigned int day,
+maketime(unsigned int year, unsigned int mon, unsigned int day,
        unsigned int hour, unsigned int min, unsigned int sec);
 extern int (*set_rtc)(void);
 
@@ -80,7 +80,7 @@
                 year += 100;
 
         xtime.tv_usec = rtctm.cs * 10000;
- xtime.tv_sec = mktime(1900 + year, rtctm.mon, rtctm.mday,
+ xtime.tv_sec = maketime(1900 + year, rtctm.mon, rtctm.mday,
                                rtctm.hours, rtctm.mins, rtctm.secs);
 }
 
diff -u -r linux-2.4.0-test10-pre5/drivers/macintosh/rtc.c linux/drivers/macintosh/rtc.c
--- linux-2.4.0-test10-pre5/drivers/macintosh/rtc.c Tue Sep 19 08:31:53 2000
+++ linux/drivers/macintosh/rtc.c Tue Oct 24 23:21:22 2000
@@ -51,7 +51,7 @@
 
         printk(KERN_INFO "rtc.c:set_rtc_time: %04d-%02d-%02d %02d:%02d:%02d.\n", t->tm_year+1900, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
 
- nowtime = mktime(t->tm_year+1900, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
+ nowtime = maketime(t->tm_year+1900, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
 
         printk(KERN_INFO "rtc.c:set_rtc_time: set rtc time to %ld seconds.\n", nowtime);
 
diff -u -r linux-2.4.0-test10-pre5/include/asm-arm/arch-ebsa285/time.h linux/include/asm-arm/arch-ebsa285/time.h
--- linux-2.4.0-test10-pre5/include/asm-arm/arch-ebsa285/time.h Mon Sep 18 15:15:23 2000
+++ linux/include/asm-arm/arch-ebsa285/time.h Tue Oct 24 23:21:22 2000
@@ -85,7 +85,7 @@
 
         // check to see if the RTC makes sense.....
         if ((CMOS_READ(RTC_VALID) & RTC_VRT) == 0)
- return mktime(1970, 1, 1, 0, 0, 0);
+ return maketime(1970, 1, 1, 0, 0, 0);
 
         /* The Linux interpretation of the CMOS clock register contents:
          * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
@@ -120,7 +120,7 @@
         }
         if ((year += 1900) < 1970)
                 year += 100;
- return mktime(year, mon, day, hour, min, sec);
+ return maketime(year, mon, day, hour, min, sec);
 }
 
 static int
diff -u -r linux-2.4.0-test10-pre5/include/asm-arm/arch-shark/time.h linux/include/asm-arm/arch-shark/time.h
--- linux-2.4.0-test10-pre5/include/asm-arm/arch-shark/time.h Mon Sep 18 15:15:23 2000
+++ linux/include/asm-arm/arch-shark/time.h Tue Oct 24 23:21:22 2000
@@ -76,7 +76,7 @@
         set_rtc_irq_bit(RTC_PIE);
 
         get_rtc_time(&r_time);
- xtime.tv_sec = mktime(r_time.tm_year+epoch, r_time.tm_mon+1, r_time.tm_mday,
+ xtime.tv_sec = maketime(r_time.tm_year+epoch, r_time.tm_mon+1, r_time.tm_mday,
                               r_time.tm_hour, r_time.tm_min, r_time.tm_sec);
 
         timer_irq.handler = timer_interrupt;
diff -u -r linux-2.4.0-test10-pre5/include/asm-arm/arch-tbox/time.h linux/include/asm-arm/arch-tbox/time.h
--- linux-2.4.0-test10-pre5/include/asm-arm/arch-tbox/time.h Mon Sep 18 15:15:23 2000
+++ linux/include/asm-arm/arch-tbox/time.h Tue Oct 24 23:21:22 2000
@@ -29,7 +29,7 @@
          * You will have to run a time daemon to set the
          * clock correctly at bootup
          */
- xtime.tv_sec = mktime(1970, 1, 1, 0, 0, 0);
+ xtime.tv_sec = maketime(1970, 1, 1, 0, 0, 0);
 
         timer_irq.handler = timer_interrupt;
         setup_arm_irq(IRQ_TIMER, &timer_irq);
diff -u -r linux-2.4.0-test10-pre5/include/asm-m68k/machdep.h linux/include/asm-m68k/machdep.h
--- linux-2.4.0-test10-pre5/include/asm-m68k/machdep.h Sat Sep 4 13:06:41 1999
+++ linux/include/asm-m68k/machdep.h Tue Oct 24 23:21:58 2000
@@ -3,7 +3,6 @@
 
 struct pt_regs;
 struct kbd_repeat;
-struct mktime;
 struct hwclk_time;
 struct gendisk;
 struct buffer_head;
diff -u -r linux-2.4.0-test10-pre5/include/linux/time.h linux/include/linux/time.h
--- linux-2.4.0-test10-pre5/include/linux/time.h Mon Oct 2 11:01:17 2000
+++ linux/include/linux/time.h Tue Oct 24 23:21:22 2000
@@ -63,7 +63,7 @@
  * will already get problems at other places on 2038-01-19 03:14:08)
  */
 static inline unsigned long
-mktime (unsigned int year, unsigned int mon,
+maketime (unsigned int year, unsigned int mon,
         unsigned int day, unsigned int hour,
         unsigned int min, unsigned int sec)
 {
diff -u -r linux-2.4.0-test10-pre5/net/khttpd/make_times_h.c linux/net/khttpd/make_times_h.c
--- linux-2.4.0-test10-pre5/net/khttpd/make_times_h.c Wed Aug 18 09:45:10 1999
+++ linux/net/khttpd/make_times_h.c Tue Oct 24 23:21:22 2000
@@ -38,7 +38,7 @@
         TM.tm_year = Y-1900;
         TM.tm_isdst = 0;
         
- return mktime(&TM);
+ return maketime(&TM);
         
 }
 static int WeekGetDay(int D,int M,int Y)
@@ -55,7 +55,7 @@
         TM.tm_wday = 0;
         TM.tm_yday = 0;
         
- (void)mktime(&TM);
+ (void)maketime(&TM);
         
         return TM.tm_wday;
         
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 31 2000 - 21:00:15 EST