aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/page
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2008-07-10 11:10:10 -0400
committerRuss Cox <rsc@swtch.com>2008-07-10 11:10:10 -0400
commita58a827f2ae0d989102dc4d8c113b9282ef177b3 (patch)
treece7b160c3393224e05a2100615c9fe48d20d2e82 /src/cmd/page
parentc224dda84efaeb28ce66e59213f3cbfde06735ac (diff)
downloadplan9port-a58a827f2ae0d989102dc4d8c113b9282ef177b3.tar.gz
plan9port-a58a827f2ae0d989102dc4d8c113b9282ef177b3.tar.bz2
plan9port-a58a827f2ae0d989102dc4d8c113b9282ef177b3.zip
lib9: add mode parameter to opentemp
Diffstat (limited to 'src/cmd/page')
-rw-r--r--src/cmd/page/filter.c2
-rw-r--r--src/cmd/page/page.h1
-rw-r--r--src/cmd/page/util.c2
-rw-r--r--src/cmd/page/view.c2
4 files changed, 3 insertions, 4 deletions
diff --git a/src/cmd/page/filter.c b/src/cmd/page/filter.c
index 2e0482fc..f9b2a8a2 100644
--- a/src/cmd/page/filter.c
+++ b/src/cmd/page/filter.c
@@ -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");
diff --git a/src/cmd/page/page.h b/src/cmd/page/page.h
index 7e6c526e..c31c1b92 100644
--- a/src/cmd/page/page.h
+++ b/src/cmd/page/page.h
@@ -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;
diff --git a/src/cmd/page/util.c b/src/cmd/page/util.c
index 1f6fdeff..74dd9bfe 100644
--- a/src/cmd/page/util.c
+++ b/src/cmd/page/util.c
@@ -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);
diff --git a/src/cmd/page/view.c b/src/cmd/page/view.c
index ab409cc7..8fc6fa79 100644
--- a/src/cmd/page/view.c
+++ b/src/cmd/page/view.c
@@ -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] == '/') {