Lines 1-5
Link Here
|
1 |
#include <stdio.h> |
1 |
#include <stdio.h> |
2 |
#include <unistd.h> |
2 |
#include <unistd.h> |
|
|
3 |
#include <time.h> |
3 |
#include <sys/types.h> |
4 |
#include <sys/types.h> |
4 |
#include <sys/stat.h> |
5 |
#include <sys/stat.h> |
5 |
#include "uint16.h" |
6 |
#include "uint16.h" |
Lines 114-123
Link Here
|
114 |
struct stat st; |
115 |
struct stat st; |
115 |
if (fstat(fd,&st) == -1) |
116 |
if (fstat(fd,&st) == -1) |
116 |
strerr_die2sys(111,FATAL,"unable to stat data: "); |
117 |
strerr_die2sys(111,FATAL,"unable to stat data: "); |
117 |
uint32_pack_big(defaultsoa,st.st_mtime); |
118 |
char buffer[12]; |
118 |
if (byte_equal(defaultsoa,4,"\0\0\0\0")) |
119 |
struct tm lt; |
119 |
defaultsoa[3] = 1; |
120 |
unsigned int recommand_ser; |
120 |
byte_copy(defaultsoa + 4,16,"\0\0\100\000\0\0\010\000\0\020\000\000\0\0\012\000"); |
121 |
localtime_r(&st.st_mtime, <); |
|
|
122 |
strftime(buffer, 12, "%Y%m%d01\n", <); |
123 |
recommand_ser = atoi(buffer); |
124 |
uint32_pack_big(defaultsoa,recommand_ser); |
125 |
byte_copy(defaultsoa + 4,16,"\0\0\004\260\0\0\004\260\0\022\165\000\0\0\016\020"); |
121 |
} |
126 |
} |
122 |
|
127 |
|
123 |
int fdcdb; |
128 |
int fdcdb; |