lib9: rewrite date routines to use /usr/share/zoneinfo directly
This commit is contained in:
parent
1cccddd6b3
commit
f35a04866f
7 changed files with 499 additions and 124 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue