lib9: rewrite date routines to use /usr/share/zoneinfo directly

This commit is contained in:
Michael Teichgräber 2008-07-09 08:27:22 -04:00
parent 1cccddd6b3
commit f35a04866f
7 changed files with 499 additions and 124 deletions

View file

@ -2,14 +2,20 @@
#include <libc.h>
int
opentemp(char *template)
opentemp(char *template, int mode)
{
int fd;
int fd, fd1;
fd = mkstemp(template);
if(fd < 0)
return -1;
remove(template);
return fd;
/* reopen for mode */
fd1 = open(template, mode);
if(fd1 < 0){
close(fd);
remove(template);
return -1;
}
close(fd);
return fd1;
}