1 diff -Nur date.freebsd/bsdcompat.h date.linux/bsdcompat.h
2 --- date.freebsd/bsdcompat.h 1970-01-01 01:00:00.000000000 +0100
3 +++ date.linux/bsdcompat.h 2007-11-28 18:11:16.735113034 +0100
12 +#include <langinfo.h>
16 +#include <sys/time.h>
20 +static inline size_t strlcpy(char *dest, const char *src, size_t n)
22 + strncpy(dest, src, n-1);
27 +static inline void warnc(int code, const char *fmt, ...)
29 + int saveerrno = errno;
38 +static inline const char *date_time_fmt(void)
40 + const char *fmt = nl_langinfo(_DATE_FMT);
44 + return "%a %b %e %H:%M:%S %Z %Y";
47 +#endif /* _BSDCOMPAT_H */
48 diff -Nur date.freebsd/date.1 date.linux/date.1
49 --- date.freebsd/date.1 2007-11-28 07:24:41.000000000 +0100
50 +++ date.linux/date.1 2007-11-28 17:42:31.472795937 +0100
52 .\" $FreeBSD: src/bin/date/date.1,v 1.75 2007/06/02 20:15:59 remko Exp $
61 .Nd display or set date and time
64 diff -Nur date.freebsd/date.c date.linux/date.c
65 --- date.freebsd/date.c 2007-11-28 07:24:41.000000000 +0100
66 +++ date.linux/date.c 2007-11-28 18:03:51.945765934 +0100
68 if (!rflag && time(&tval) == -1)
72 + format = date_time_fmt();
74 /* allow the operands in any order */
75 if (*argv && **argv == '+') {
76 diff -Nur date.freebsd/libutil.h date.linux/libutil.h
77 --- date.freebsd/libutil.h 1970-01-01 01:00:00.000000000 +0100
78 +++ date.linux/libutil.h 2007-11-28 17:45:10.093835235 +0100
81 diff -Nur date.freebsd/Makefile date.linux/Makefile
82 --- date.freebsd/Makefile 1970-01-01 01:00:00.000000000 +0100
83 +++ date.linux/Makefile 2007-11-28 18:17:20.815860813 +0100
87 +CPPFLAGS=-I. -include bsdcompat.h
91 +date: date.o netdate.o vary.o
92 + $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(LIBS)
94 +date.o: extern.h vary.h libutil.h bsdcompat.h
95 +netdate.o: extern.h bsdcompat.h
96 +vary.o: vary.h bsdcompat.h