lib9: add mode parameter to opentemp
This commit is contained in:
parent
c224dda84e
commit
a58a827f2a
9 changed files with 23 additions and 34 deletions
|
|
@ -32,7 +32,7 @@ initfilt(Biobuf *b, int argc, char **argv, uchar *buf, int nbuf, char *type, cha
|
|||
p[1] = open("/dev/null", ORDWR);
|
||||
}
|
||||
|
||||
ofd = opentemp(template);
|
||||
ofd = opentemp(template, ORDWR|ORCLOSE);
|
||||
switch(fork()){
|
||||
case -1:
|
||||
fprint(2, "fork fails: %r\n");
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ int min(int, int);
|
|||
void wexits(char*);
|
||||
Image* xallocimage(Display*, Rectangle, ulong, int, ulong);
|
||||
int bell(void*, char*);
|
||||
int opentemp(char *template);
|
||||
Image* convert(Graphic *g);
|
||||
|
||||
extern int stdinfd;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ spooltodisk(uchar *ibuf, int in, char **name)
|
|||
char temp[40];
|
||||
|
||||
strcpy(temp, "/tmp/pagespoolXXXXXXXXX");
|
||||
fd = opentemp(temp);
|
||||
fd = opentemp(temp, ORDWR|ORCLOSE);
|
||||
if(name)
|
||||
*name = estrdup(temp);
|
||||
|
||||
|
|
|
|||
|
|
@ -732,7 +732,7 @@ viewer(Document *dd)
|
|||
}
|
||||
if(showdata(pm)) {
|
||||
s = estrdup("/tmp/pageplumbXXXXXXX");
|
||||
fd = opentemp(s);
|
||||
fd = opentemp(s, ORDWR|ORCLOSE);
|
||||
write(fd, pm->data, pm->ndata);
|
||||
/* lose fd reference on purpose; the file is open ORCLOSE */
|
||||
} else if(pm->data[0] == '/') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue