summaryrefslogtreecommitdiffstats
path: root/src/cmd/page/util.c
diff options
context:
space:
mode:
authorJ.R. Mauro <jrm8005@gmail.com>2009-08-20 14:38:31 -0400
committerJ.R. Mauro <jrm8005@gmail.com>2009-08-20 14:38:31 -0400
commit2fb0c4447ef493da81703dd20090676ed8cae834 (patch)
treea308d23de5314957225cecad4300d1ef1f23f36b /src/cmd/page/util.c
parent8ff457f56db9f94f4baf68f53d87e791584d1dfe (diff)
downloadplan9port-2fb0c4447ef493da81703dd20090676ed8cae834.tar.gz
plan9port-2fb0c4447ef493da81703dd20090676ed8cae834.zip
page: remove temporary file at program exit; fixes reading from stdin
http://codereview.appspot.com/105097
Diffstat (limited to 'src/cmd/page/util.c')
-rw-r--r--src/cmd/page/util.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/cmd/page/util.c b/src/cmd/page/util.c
index 74dd9bfe..f10ef6db 100644
--- a/src/cmd/page/util.c
+++ b/src/cmd/page/util.c
@@ -50,12 +50,11 @@ spooltodisk(uchar *ibuf, int in, char **name)
{
uchar buf[8192];
int fd, n;
- char temp[40];
-
- strcpy(temp, "/tmp/pagespoolXXXXXXXXX");
- fd = opentemp(temp, ORDWR|ORCLOSE);
+
+ strcpy(tempfile, "/tmp/pagespoolXXXXXXXXX");
+ fd = opentemp(tempfile, ORDWR);
if(name)
- *name = estrdup(temp);
+ *name = estrdup(tempfile);
if(write(fd, ibuf, in) != in){
fprint(2, "error writing temporary file\n");