16static char *montab[12] = {
17"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
23int main(
int argc,
char *
const *argv)
39 logmsg(
WHO,100,USAGE,
"predate child");
42 logmsg(
WHO,111,FATAL,
"unable to create pipe");
44 switch (pid = fork()) {
46 logmsg(
WHO,111,FATAL,
"unable to fork");
49 if (fd_move(0,pi[0]) == -1)
50 logmsg(
WHO,111,FATAL,
"unable to set up fds");
52 execvp(argv[1],argv + 1);
53 logmsg(
WHO,111,FATAL,B(
"unable to run: ",argv[1]));
78 buffer_puts(&
bo,
"Date: ");
81 buffer_puts(&
bo,montab[
dt.
mon]);
92 minutes = (utc -
local + 30) / 60;
93 buffer_puts(&
bo,
" -");
94 buffer_put(&
bo,
num,fmt_uint0(
num,minutes / 60,2));
95 buffer_put(&
bo,
num,fmt_uint0(
num,minutes % 60,2));
98 minutes = (
local - utc + 30) / 60;
99 buffer_puts(&
bo,
" +");
100 buffer_put(&
bo,
num,fmt_uint0(
num,minutes / 60,2));
101 buffer_put(&
bo,
num,fmt_uint0(
num,minutes % 60,2));
104 buffer_puts(&
bo,
"\n");
105 buffer_copy(&
bo,buffer_0);
109 if (wait_pid(&wstat,pid) == -1)
110 logmsg(
WHO,111,FATAL,
"wait failed");
111 if (wait_crashed(wstat))
112 logmsg(
WHO,111,FATAL,
"child crashed");
113 _exit(wait_exitcode(wstat));
datetime_sec datetime_untai(struct datetime *dt)
char outbuf[BUFSIZE_LINE]