You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
935 B
41 lines
935 B
Index: environ.c |
|
--- environ.c.orig Sat Jan 24 22:25:16 2004 |
|
+++ environ.c Sat Jan 24 22:26:27 2004 |
|
@@ -430,18 +430,13 @@ |
|
|
|
#define SUBS_DEFINED |
|
|
|
+#include <stdio.h> |
|
+#include <stdlib.h> |
|
+#include <string.h> |
|
#include <time.h> |
|
#include <sys/types.h> |
|
#include <utime.h> |
|
- |
|
-#ifndef time_t |
|
-#define time_t long |
|
-#endif |
|
- |
|
-extern struct tm *localtime(); |
|
-extern time_t time(); |
|
-extern char *strcpy(); |
|
-extern voidp *malloc(); |
|
+#include <unistd.h> |
|
|
|
FILE * |
|
file_open(name, mode) |
|
@@ -545,12 +540,12 @@ |
|
#define SEC_IN_DAY (24L * 60L * 60L) |
|
#define INV_VALUE (SEC_IN_DAY + 1L) |
|
static long retval = INV_VALUE; |
|
- long now, noon; |
|
+ time_t now, noon; |
|
struct tm *noontm; |
|
|
|
if (retval != INV_VALUE) |
|
return retval; |
|
- now = (long) time((long *) 0); |
|
+ now = time(NULL); |
|
/* Find local time for GMT noon today */ |
|
noon = now - now % SEC_IN_DAY + NOONOFFSET ; |
|
noontm = localtime(&noon);
|
|
|